From 67b4d2e2f41ebb9ec828f572d2b524a14d4d5613 Mon Sep 17 00:00:00 2001 From: Jacob Barthelmeh Date: Fri, 25 Mar 2016 14:19:51 -0600 Subject: [PATCH] case where memory is exhausted before ctx copied to ssl --- src/internal.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/internal.c b/src/internal.c index 09ca058e9..70bb27900 100644 --- a/src/internal.c +++ b/src/internal.c @@ -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); }