Commit e224c453 authored by Doug Hogan's avatar Doug Hogan Committed by Kurt Roeckx
Browse files

Avoid a double-free in an error path.



Signed-off-by: default avatarKurt Roeckx <kurt@roeckx.be>
Reviewed-by: default avatarMatt Caswell <matt@openssl.org>
(cherry picked from commit 1549a265)
parent e961fa44
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -258,6 +258,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(NID_dhKeyAgreement), 0,
                         V_ASN1_SEQUENCE, params, dp, dplen))