Skip to content

Commit

Permalink
Merge pull request #8317 from night1rider/CID_444416
Browse files Browse the repository at this point in the history
Free Val and Oid before returning error
  • Loading branch information
JacobBarthelmeh authored Dec 24, 2024
2 parents 838fe22 + 545257e commit 17c17cd
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/x509.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,6 +1480,8 @@ int wolfSSL_X509_add_ext(WOLFSSL_X509 *x509, WOLFSSL_X509_EXTENSION *ext,

/* ext->crit is WOLFSSL_ASN1_BOOLEAN */
if (ext->crit != 0 && ext->crit != -1) {
XFREE(val, x509->heap, DYNAMIC_TYPE_X509_EXT);
XFREE(oid, x509->heap, DYNAMIC_TYPE_X509_EXT);
return WOLFSSL_FAILURE;
}

Expand Down

0 comments on commit 17c17cd

Please sign in to comment.