From fa01370f7dc8f0a379483bbe74de11225857e5fe Mon Sep 17 00:00:00 2001 From: Bernd Edlinger Date: Sat, 7 Sep 2019 00:53:24 +0200 Subject: [PATCH] Use BN_clear_free in DH_set0_key Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/9796) --- crypto/dh/dh_lib.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crypto/dh/dh_lib.c b/crypto/dh/dh_lib.c index df3166279e..0382e442d5 100644 --- a/crypto/dh/dh_lib.c +++ b/crypto/dh/dh_lib.c @@ -235,11 +235,11 @@ void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { if (pub_key != NULL) { - BN_free(dh->pub_key); + BN_clear_free(dh->pub_key); dh->pub_key = pub_key; } if (priv_key != NULL) { - BN_free(dh->priv_key); + BN_clear_free(dh->priv_key); dh->priv_key = priv_key; } -- 2.25.1