src/ssl_sess.c: in EvictSessionFromCache(), free session->ticketNonce.data if it was dynamically allocated. fixes memory leak via wolfSSL_Cleanup().

pull/7687/head
Daniel Pouzzner 2024-06-26 14:15:42 -05:00
parent 474b8a0673
commit 4d43dbf83b
1 changed files with 11 additions and 0 deletions

View File

@ -215,6 +215,17 @@
#ifdef HAVE_EX_DATA
session->ownExData = save_ownExData;
#endif
#if defined(WOLFSSL_TLS13) && defined(HAVE_SESSION_TICKET) && \
defined(WOLFSSL_TICKET_NONCE_MALLOC) && \
(!defined(HAVE_FIPS) || (defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,3)))
if ((session->ticketNonce.data != NULL) &&
(session->ticketNonce.data != session->ticketNonce.dataStatic))
{
XFREE(session->ticketNonce.data, NULL, DYNAMIC_TYPE_SESSION_TICK);
session->ticketNonce.data = NULL;
}
#endif
}
WOLFSSL_ABI