From 97323d57cd6dbbd0c06383dea3cc1b90d11f2557 Mon Sep 17 00:00:00 2001 From: Matt Caswell Date: Wed, 27 Apr 2016 15:03:26 +0100 Subject: [PATCH] Don't leak memory in v2i_AUTHORITY_KEYID The v2i_AUTHORITY_KEYID() function can leak memory under an error condition. Reviewed-by: Richard Levitte --- crypto/x509v3/v3_akey.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crypto/x509v3/v3_akey.c b/crypto/x509v3/v3_akey.c index a7d0b290f1..d9f770433c 100644 --- a/crypto/x509v3/v3_akey.c +++ b/crypto/x509v3/v3_akey.c @@ -143,12 +143,16 @@ static AUTHORITY_KEYID *v2i_AUTHORITY_KEYID(X509V3_EXT_METHOD *method, } akeyid->issuer = gens; + gen = NULL; + gens = NULL; akeyid->serial = serial; akeyid->keyid = ikeyid; return akeyid; err: + sk_GENERAL_NAME_free(gens); + GENERAL_NAME_free(gen); X509_NAME_free(isname); ASN1_INTEGER_free(serial); ASN1_OCTET_STRING_free(ikeyid); -- 2.25.1