From 79e2e927e6e904a4b15e35c64eeb1461630cfe49 Mon Sep 17 00:00:00 2001 From: Doug Hogan Date: Wed, 7 Jan 2015 18:21:01 -0800 Subject: [PATCH] Avoid a double-free in an error path. Signed-off-by: Kurt Roeckx Reviewed-by: Matt Caswell (cherry picked from commit 1549a265209d449b6aefd2b49d7d39f7fbe0689b) --- crypto/dh/dh_ameth.c | 1 + 1 file changed, 1 insertion(+) diff --git a/crypto/dh/dh_ameth.c b/crypto/dh/dh_ameth.c index a8349e7370..533080aeeb 100644 --- a/crypto/dh/dh_ameth.c +++ b/crypto/dh/dh_ameth.c @@ -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)) -- 2.25.1