Fix potential memory leak in dh_ameth.c
authorScott Wilson <scott@sawilson.xyz>
Thu, 31 Oct 2019 11:37:51 +0000 (22:37 +1100)
committerPatrick Steuer <patrick.steuer@de.ibm.com>
Fri, 1 Nov 2019 11:39:46 +0000 (12:39 +0100)
Free dukm in error handling of dh_cms_encrypt()

Fixes #10294

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Patrick Steuer <patrick.steuer@de.ibm.com>
(Merged from https://github.com/openssl/openssl/pull/10310)

crypto/dh/dh_ameth.c

index abb9bfdcbe282bf4f12d65108cf7af14a867883d..7907f50192af49c83f19e48cdfc341a8f0ec7bec 100644 (file)
@@ -976,6 +976,7 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
  err:
     OPENSSL_free(penc);
     X509_ALGOR_free(wrap_alg);
+    OPENSSL_free(dukm);
     return rv;
 }