Fix potential memory leak in dh_ameth.c

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)

(cherry picked from commit 6624e1f7b6a397948561e9cc2774f0c8af1d2c79)
This commit is contained in:
Scott Wilson 2019-10-31 22:37:51 +11:00 committed by Patrick Steuer
parent 689c07b8d5
commit c38761171f

View file

@ -901,6 +901,7 @@ static int dh_cms_encrypt(CMS_RecipientInfo *ri)
err:
OPENSSL_free(penc);
X509_ALGOR_free(wrap_alg);
OPENSSL_free(dukm);
return rv;
}