Skip to content

Commit 8760ad9

Browse files
Fix for CID 299847 memory leak on error case
1 parent 7b20a55 commit 8760ad9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

src/x509.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1549,11 +1549,13 @@ int wolfSSL_X509V3_EXT_print(WOLFSSL_BIO *out, WOLFSSL_X509_EXTENSION *ext,
15491549
if ((valLen = XSNPRINTF(val, len, "%*s%s,",
15501550
indent, "", str->strData))
15511551
>= len)
1552+
XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER);
15521553
return rc;
15531554
} else {
15541555
if ((valLen = XSNPRINTF(val, len, "%*s%s",
15551556
indent, "", str->strData))
15561557
>= len)
1558+
XFREE(val, NULL, DYNAMIC_TYPE_TMP_BUFFER);
15571559
return rc;
15581560
}
15591561
if (tmpLen + valLen > tmpSz) {

0 commit comments

Comments
 (0)