Merge pull request #7124 from SKlimaRA/SKlimaRA/tls13SessionTicketDoubleFree
fixed double free happening during EvictSessionFromCache
This commit is contained in:
commit
49d258f01a
@ -19774,12 +19774,17 @@ void wolfSSL_FreeSession(WOLFSSL_CTX* ctx, WOLFSSL_SESSION* session)
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
if (session->ticketLenAlloc > 0) {
|
||||
XFREE(session->ticket, session->heap, DYNAMIC_TYPE_SESSION_TICK);
|
||||
session->ticket = session->staticTicket;
|
||||
session->ticketLen = 0;
|
||||
session->ticketLenAlloc = 0;
|
||||
}
|
||||
#if defined(WOLFSSL_TLS13) && defined(WOLFSSL_TICKET_NONCE_MALLOC) && \
|
||||
(!defined(HAVE_FIPS) || (defined(FIPS_VERSION_GE) && FIPS_VERSION_GE(5,3)))
|
||||
if (session->ticketNonce.data != session->ticketNonce.dataStatic) {
|
||||
XFREE(session->ticketNonce.data, session->heap,
|
||||
DYNAMIC_TYPE_SESSION_TICK);
|
||||
session->ticketNonce.data = session->ticketNonce.dataStatic;
|
||||
session->ticketNonce.len = 0;
|
||||
}
|
||||
#endif /* WOLFSSL_TLS13 && WOLFSSL_TICKET_NONCE_MALLOC && FIPS_VERSION_GE(5,3)*/
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user