forked from wolfSSL/wolfssl
Moved the x509 XFREE to outside the FreeX509 function. Internally FreeX509 is only used in two places. One is for the ssl->peerCert, which is not dynamic anyways. The second is in the ExternalFreeX509 where it calls FreeX509 if its dynamic and will XFREE there.
This commit is contained in:
@@ -1695,8 +1695,6 @@ void FreeX509(WOLFSSL_X509* x509)
|
|||||||
#endif /* OPENSSL_EXTRA */
|
#endif /* OPENSSL_EXTRA */
|
||||||
if (x509->altNames)
|
if (x509->altNames)
|
||||||
FreeAltNames(x509->altNames, NULL);
|
FreeAltNames(x509->altNames, NULL);
|
||||||
if (x509->dynamicMemory)
|
|
||||||
XFREE(x509, NULL, DYNAMIC_TYPE_X509);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -9424,6 +9424,7 @@ static void ExternalFreeX509(WOLFSSL_X509* x509)
|
|||||||
if (x509) {
|
if (x509) {
|
||||||
if (x509->dynamicMemory) {
|
if (x509->dynamicMemory) {
|
||||||
FreeX509(x509);
|
FreeX509(x509);
|
||||||
|
XFREE(x509, NULL, DYNAMIC_TYPE_X509);
|
||||||
} else {
|
} else {
|
||||||
WOLFSSL_MSG("free called on non dynamic object, not freeing");
|
WOLFSSL_MSG("free called on non dynamic object, not freeing");
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user