From: FdaSilvaYY Date: Fri, 11 Nov 2016 09:58:34 +0000 (+0100) Subject: Missing free item on push failure X-Git-Tag: OpenSSL_1_1_1-pre1~3026 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=2d13250fd695eba777fe7e2af4beb1b7d356bd8f;p=oweals%2Fopenssl.git Missing free item on push failure Reviewed-by: Andy Polyakov Reviewed-by: Rich Salz (Merged from https://github.com/openssl/openssl/pull/1905) --- 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;