mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
Avoid a double-free in an error path.
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org>
This commit is contained in:
parent
ba4bdee718
commit
1549a26520
@ -283,6 +283,7 @@ static int dh_priv_encode(PKCS8_PRIV_KEY_INFO *p8, const EVP_PKEY *pkey)
|
||||
dplen = i2d_ASN1_INTEGER(prkey, &dp);
|
||||
|
||||
ASN1_INTEGER_free(prkey);
|
||||
prkey = NULL;
|
||||
|
||||
if (!PKCS8_pkey_set0(p8, OBJ_nid2obj(pkey->ameth->pkey_id), 0,
|
||||
V_ASN1_SEQUENCE, params, dp, dplen))
|
||||
|
Loading…
Reference in New Issue
Block a user