mirror of https://github.com/wolfSSL/wolfssl.git
1. Use the session deallocator on the deserialized session in the client.
2. Free the flatten session if the size check fails.pull/2463/head
parent
c27a4b3865
commit
b70f22e21a
|
@ -2997,8 +2997,10 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||
int checkSz = wolfSSL_i2d_SSL_SESSION(session, &flatSession);
|
||||
if (flatSession == NULL)
|
||||
err_sys("error creating flattened session buffer");
|
||||
if (checkSz != flatSessionSz)
|
||||
if (checkSz != flatSessionSz) {
|
||||
XFREE(flatSession, NULL, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
err_sys("flat session size check failure");
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -3090,7 +3092,7 @@ THREAD_RETURN WOLFSSL_THREAD client_test(void* args)
|
|||
#if defined(OPENSSL_EXTRA) && defined(HAVE_EXT_CACHE)
|
||||
if (flatSession) {
|
||||
XFREE(flatSession, heap, DYNAMIC_TYPE_TMP_BUFFER);
|
||||
XFREE(session, heap, DYNAMIC_TYPE_OPENSSL);
|
||||
wolfSSL_SESSION_free(session);
|
||||
}
|
||||
#endif
|
||||
#ifdef HAVE_SESSION_TICKET
|
||||
|
|
Loading…
Reference in New Issue