mirror of
https://github.com/QuasarApp/openssl.git
synced 2025-05-11 08:59:40 +00:00
dh: fix coverty 1474423: resource leak
Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14637)
This commit is contained in:
parent
9ca269af63
commit
9d8c53ed16
@ -161,6 +161,7 @@ DH *ossl_dh_key_from_pkcs8(const PKCS8_PRIV_KEY_INFO *p8inf,
|
|||||||
if ((privkey_bn = BN_secure_new()) == NULL
|
if ((privkey_bn = BN_secure_new()) == NULL
|
||||||
|| !ASN1_INTEGER_to_BN(privkey, privkey_bn)) {
|
|| !ASN1_INTEGER_to_BN(privkey, privkey_bn)) {
|
||||||
ERR_raise(ERR_LIB_DH, DH_R_BN_ERROR);
|
ERR_raise(ERR_LIB_DH, DH_R_BN_ERROR);
|
||||||
|
BN_clear_free(privkey_bn);
|
||||||
goto dherr;
|
goto dherr;
|
||||||
}
|
}
|
||||||
if (!DH_set0_key(dh, NULL, privkey_bn))
|
if (!DH_set0_key(dh, NULL, privkey_bn))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user