diff --git a/src/internal.c b/src/internal.c index 8e559a728..359d2fcdf 100644 --- a/src/internal.c +++ b/src/internal.c @@ -14341,7 +14341,7 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif { ssl->options.cacheMessages = 0; - if (ssl->hsHashes->messages != NULL) { + if ((ssl->hsHashes != NULL) && (ssl->hsHashes->messages != NULL)) { XFREE(ssl->hsHashes->messages, ssl->heap, DYNAMIC_TYPE_HASHES); ssl->hsHashes->messages = NULL; @@ -14427,7 +14427,7 @@ static int DoHandShakeMsgType(WOLFSSL* ssl, byte* input, word32* inOutIdx, #endif { ssl->options.cacheMessages = 0; - if (ssl->hsHashes->messages != NULL) { + if ((ssl->hsHashes != NULL) && (ssl->hsHashes->messages != NULL)) { XFREE(ssl->hsHashes->messages, ssl->heap, DYNAMIC_TYPE_HASHES); ssl->hsHashes->messages = NULL; }