summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFdaSilvaYY <fdasilvayy@gmail.com>2016-11-11 10:58:34 +0100
committerRich Salz <rsalz@openssl.org>2016-11-16 20:54:53 -0500
commit2d13250fd695eba777fe7e2af4beb1b7d356bd8f (patch)
treec6b5a192f2a9a62c631bc108b8a415f3dcd5c772
parent71a8b85574aefaad93e4fe50ed2fc7a5923c6b29 (diff)
Missing free item on push failure
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/1905)
-rw-r--r--crypto/x509v3/v3_utl.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/crypto/x509v3/v3_utl.c b/crypto/x509v3/v3_utl.c
index 05edd85cf4..7dc9a4533e 100644
--- a/crypto/x509v3/v3_utl.c
+++ b/crypto/x509v3/v3_utl.c
@@ -469,6 +469,7 @@ static int append_ia5(STACK_OF(OPENSSL_STRING) **sk, const ASN1_IA5STRING *email
return 1;
emtmp = OPENSSL_strdup((char *)email->data);
if (emtmp == NULL || !sk_OPENSSL_STRING_push(*sk, emtmp)) {
+ OPENSSL_free(emtmp); /* free on push failure */
X509_email_free(*sk);
*sk = NULL;
return 0;