Skip to content

Commit 23f54c5

Browse files
Fix memory leak in X509StoreRemoveCa.
1 parent f26d468 commit 23f54c5

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/x509_str.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1466,8 +1466,11 @@ static int X509StoreRemoveCa(WOLFSSL_X509_STORE* store,
14661466
wc_InitDecodedCert(dCert, x509->derCert->buffer,
14671467
x509->derCert->length, NULL);
14681468
result = wc_ParseCert(dCert, CA_TYPE, NO_VERIFY, store->cm);
1469-
if (result)
1469+
if (result) {
1470+
wc_FreeDecodedCert(dCert);
1471+
XFREE(dCert, NULL, DYNAMIC_TYPE_DCERT);
14701472
return WOLFSSL_FATAL_ERROR;
1473+
}
14711474

14721475
result = RemoveCA(store->cm, dCert->extSubjKeyId, type);
14731476
}

0 commit comments

Comments
 (0)