case where memory is exhausted before ctx copied to ssl

This commit is contained in:
Jacob Barthelmeh
2016-03-25 14:19:51 -06:00
parent 696169634e
commit 67b4d2e2f4

View File

@@ -2345,7 +2345,9 @@ void FreeHandshakeResources(WOLFSSL* ssl)
void FreeSSL(WOLFSSL* ssl)
{
FreeSSL_Ctx(ssl->ctx); /* will decrement and free underyling CTX if 0 */
if (ssl->ctx) {
FreeSSL_Ctx(ssl->ctx); /* will decrement and free underyling CTX if 0 */
}
SSL_ResourceFree(ssl);
XFREE(ssl, ssl->heap, DYNAMIC_TYPE_SSL);
}