From 8760ad947314833bfd4a7d7dd46a05193a4af9ee Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Fri, 27 Oct 2023 14:17:31 -0600 Subject: [PATCH] Fix for CID 299847 memory leak on error case --- src/x509.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/x509.c b/src/x509.c index 0780601e4..68337a6e8 100644 --- a/src/x509.c +++ b/src/x509.c @@ -1549,11 +1549,13 @@ int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out, WOLFSSL_X509_EXTENSION *ext, if ((valLen = XSNPRINTF(val, len, "%*s%s,", indent, "", str->strData)) >= len) + XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER); return rc; } else { if ((valLen = XSNPRINTF(val, len, "%*s%s", indent, "", str->strData)) >= len) + XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER); return rc; } if (tmpLen + valLen > tmpSz) {