From 27267d7d2e057e25a76685d3e8e53fc45d0216dc Mon Sep 17 00:00:00 2001 From: JacobBarthelmeh Date: Tue, 22 Oct 2024 00:21:26 -0600 Subject: [PATCH] CID 426066 fix check if null before free --- src/x509.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/x509.c b/src/x509.c index 58f5cc119..c19b2bbed 100644 --- a/src/x509.c +++ b/src/x509.c @@ -14111,7 +14111,9 @@ int wolfSSL_X509_check_ip_asc(WOLFSSL_X509 *x, const char *ipasc, } #ifdef WOLFSSL_SMALL_STACK - XFREE(dCert, x->heap, DYNAMIC_TYPE_DCERT); + if (x != NULL) { + XFREE(dCert, x->heap, DYNAMIC_TYPE_DCERT); + } #endif return ret;