diff --git a/src/internal.c b/src/internal.c index 91caeeb3f..911bef531 100644 --- a/src/internal.c +++ b/src/internal.c @@ -1695,8 +1695,6 @@ void FreeX509(WOLFSSL_X509* x509) #endif /* OPENSSL_EXTRA */ if (x509->altNames) FreeAltNames(x509->altNames, NULL); - if (x509->dynamicMemory) - XFREE(x509, NULL, DYNAMIC_TYPE_X509); } diff --git a/src/ssl.c b/src/ssl.c index 8e788a4bf..29c6f8ca6 100644 --- a/src/ssl.c +++ b/src/ssl.c @@ -9424,6 +9424,7 @@ static void ExternalFreeX509(WOLFSSL_X509* x509) if (x509) { if (x509->dynamicMemory) { FreeX509(x509); + XFREE(x509, NULL, DYNAMIC_TYPE_X509); } else { WOLFSSL_MSG("free called on non dynamic object, not freeing"); }