Sanity check before free

This commit is contained in:
Hideki Miyazaki
2025-07-17 18:51:57 +09:00
parent ec252a73e2
commit ba358b8fb8

View File

@@ -308,8 +308,10 @@ int tsip_TlsCleanup(struct WOLFSSL* ssl)
/* free stored messages */
tsipFlushMessages(ssl);
/* free internal structure */
if (tuc->internal) {
XFREE(tuc->internal, ssl->heap, DYNAMIC_TYPE_TMP_BUFFER);
tuc->internal = NULL;
}
/* zero clear */
ForceZero(tuc, sizeof(TsipUserCtx));