From c192cbabe8a53472b8bf84a00fe7234c24f5c5f2 Mon Sep 17 00:00:00 2001 From: Colton Willey Date: Wed, 4 Dec 2024 10:33:58 -0800 Subject: [PATCH] Free x509 on fail to push --- src/x509_str.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x509_str.c b/src/x509_str.c index bdb388f86..ce8f0e28e 100644 --- a/src/x509_str.c +++ b/src/x509_str.c @@ -1411,6 +1411,7 @@ int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) } else { result = WOLFSSL_FATAL_ERROR; + wolfSSL_X509_free(x509); } } } @@ -1425,6 +1426,7 @@ int wolfSSL_X509_STORE_add_cert(WOLFSSL_X509_STORE* store, WOLFSSL_X509* x509) } else { result = WOLFSSL_FATAL_ERROR; + wolfSSL_X509_free(x509); } } }