From 576bcdb5bdc1311064a108098eedc4a0723615ba Mon Sep 17 00:00:00 2001 From: Pauli Date: Mon, 27 Apr 2020 08:45:04 +1000 Subject: [PATCH] coverity 1462556 Resource leak Reviewed-by: Tomas Mraz (Merged from https://github.com/openssl/openssl/pull/11651) --- crypto/x509/v3_tlsf.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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; } -- 2.25.1