diff options
author | Pauli <paul.dale@oracle.com> | 2020-04-27 08:45:04 +1000 |
---|---|---|
committer | Pauli <paul.dale@oracle.com> | 2020-04-30 20:21:32 +1000 |
commit | 576bcdb5bdc1311064a108098eedc4a0723615ba (patch) | |
tree | e7245204cb267d2244832460978a9c8ad3f89ed2 | |
parent | 9dbfb11d5a204badbc28dec27cb98121bb00f996 (diff) |
coverity 1462556 Resource leak
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11651)
-rw-r--r-- | crypto/x509/v3_tlsf.c | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |