forked from wolfSSL/wolfssl
Fix static memory failure case (insuficient mem) in InitSSL case where ssl->ctx
isn't set yet and SSL_ResourceFree
is called NULL dereferece happens.
This commit is contained in:
@ -4864,9 +4864,10 @@ void SSL_ResourceFree(WOLFSSL* ssl)
|
|||||||
|
|
||||||
/* check if tracking stats */
|
/* check if tracking stats */
|
||||||
if (ctx_heap->flag & WOLFMEM_TRACK_STATS) {
|
if (ctx_heap->flag & WOLFMEM_TRACK_STATS) {
|
||||||
XFREE(ssl_hint->stats, ssl->heap, DYNAMIC_TYPE_SSL);
|
XFREE(ssl_hint->stats, ssl->ctx ? ssl->ctx->heap : NULL,
|
||||||
|
DYNAMIC_TYPE_SSL);
|
||||||
}
|
}
|
||||||
XFREE(ssl->heap, ssl->heap, DYNAMIC_TYPE_SSL);
|
XFREE(ssl->heap, ssl->ctx ? ssl->ctx->heap : NULL, DYNAMIC_TYPE_SSL);
|
||||||
#ifdef WOLFSSL_HEAP_TEST
|
#ifdef WOLFSSL_HEAP_TEST
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user