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
John Safranek 2019-09-12 16:02:36 -07:00
parent c27a4b3865
commit b70f22e21a
1 changed files with 4 additions and 2 deletions

View File

@ -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