summaryrefslogtreecommitdiffstats
path: root/crypto/dh
diff options
context:
space:
mode:
authorDoug Hogan <doug@acyclic.org>2015-01-07 18:21:01 -0800
committerKurt Roeckx <kurt@roeckx.be>2015-02-22 13:23:52 +0100
commit79e2e927e6e904a4b15e35c64eeb1461630cfe49 (patch)
tree073fee72ea85b197c5e9e9f1049983bd6a172541 /crypto/dh
parent7f3563b576c0cf6fe6621f1d2dd92ec67d7e58e2 (diff)
Avoid a double-free in an error path.
Signed-off-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Matt Caswell <matt@openssl.org> (cherry picked from commit 1549a265209d449b6aefd2b49d7d39f7fbe0689b)
Diffstat (limited to 'crypto/dh')
-rw-r--r--crypto/dh/dh_ameth.c1
1 files changed, 1 insertions, 0 deletions
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))