From: Pauli Date: Sun, 26 Apr 2020 22:45:04 +0000 (+1000) Subject: coverity 1462556 Resource leak X-Git-Tag: openssl-3.0.0-alpha2~123 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=576bcdb5bdc1311064a108098eedc4a0723615ba;p=oweals%2Fopenssl.git coverity 1462556 Resource leak Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11651) --- diff --git a/crypto/x509/v3_tlsf.c b/crypto/x509/v3_tlsf.c index 597e8eda5e..ec9652aeef 100644 --- a/crypto/x509/v3_tlsf.c +++ b/crypto/x509/v3_tlsf.c @@ -91,7 +91,7 @@ static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method, { TLS_FEATURE *tlsf; char *extval, *endptr; - ASN1_INTEGER *ai; + ASN1_INTEGER *ai = NULL; CONF_VALUE *val; int i; size_t j; @@ -130,10 +130,13 @@ static TLS_FEATURE *v2i_TLS_FEATURE(const X509V3_EXT_METHOD *method, X509V3err(X509V3_F_V2I_TLS_FEATURE, ERR_R_MALLOC_FAILURE); goto err; } + /* So it doesn't get purged if an error occurs next time around */ + ai = NULL; } return tlsf; err: sk_ASN1_INTEGER_pop_free(tlsf, ASN1_INTEGER_free); + ASN1_INTEGER_free(ai); return NULL; }