summaryrefslogtreecommitdiffstats
path: root/crypto/x509v3
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-04-27 15:03:26 +0100
committerMatt Caswell <matt@openssl.org>2016-06-01 18:00:53 +0100
commit97323d57cd6dbbd0c06383dea3cc1b90d11f2557 (patch)
tree9c10090e7f1b947064b7309c5f10090aecf83835 /crypto/x509v3
parent1c422164d8343688b8356fcb26f6b7e06921433b (diff)
Don't leak memory in v2i_AUTHORITY_KEYID
The v2i_AUTHORITY_KEYID() function can leak memory under an error condition. Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'crypto/x509v3')
-rw-r--r--crypto/x509v3/v3_akey.c4
1 files changed, 4 insertions, 0 deletions
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);