forked from wolfSSL/wolfssl
fix NULL pointer dereference in wolfSSL_CTX_new() for ctx->srp if ctx is NULL
This commit is contained in:
@ -326,6 +326,7 @@ WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD* method)
|
||||
void wolfSSL_CTX_free(WOLFSSL_CTX* ctx)
|
||||
{
|
||||
WOLFSSL_ENTER("SSL_CTX_free");
|
||||
if (ctx) {
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFCRYPT_HAVE_SRP) \
|
||||
&& !defined(NO_SHA256) && !defined(WC_NO_RNG)
|
||||
if (ctx->srp != NULL){
|
||||
@ -336,8 +337,8 @@ void wolfSSL_CTX_free(WOLFSSL_CTX* ctx)
|
||||
XFREE(ctx->srp, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
}
|
||||
#endif
|
||||
if (ctx)
|
||||
FreeSSL_Ctx(ctx);
|
||||
}
|
||||
|
||||
WOLFSSL_LEAVE("SSL_CTX_free", 0);
|
||||
}
|
||||
|
Reference in New Issue
Block a user