mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-08-01 03:34:39 +02:00
Free'ing ctx->srp has to be reference counted as well
This commit is contained in:
@@ -3023,7 +3023,16 @@ void FreeSSL_Ctx(WOLFSSL_CTX* ctx)
|
||||
|
||||
if (isZero) {
|
||||
WOLFSSL_MSG("CTX ref count down to 0, doing full free");
|
||||
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFCRYPT_HAVE_SRP) && \
|
||||
!defined(NO_SHA256) && !defined(WC_NO_RNG)
|
||||
if (ctx->srp != NULL) {
|
||||
XFREE(ctx->srp_password, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
ctx->srp_password = NULL;
|
||||
wc_SrpTerm(ctx->srp);
|
||||
XFREE(ctx->srp, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
ctx->srp = NULL;
|
||||
}
|
||||
#endif
|
||||
SSL_CtxResourceFree(ctx);
|
||||
#if defined(HAVE_SESSION_TICKET) && !defined(NO_WOLFSSL_SERVER) && \
|
||||
!defined(WOLFSSL_NO_DEF_TICKET_ENC_CB) && !defined(NO_TLS)
|
||||
|
10
src/ssl.c
10
src/ssl.c
@@ -1194,16 +1194,6 @@ void wolfSSL_CTX_free(WOLFSSL_CTX* ctx)
|
||||
{
|
||||
WOLFSSL_ENTER("wolfSSL_CTX_free");
|
||||
if (ctx) {
|
||||
#if defined(OPENSSL_EXTRA) && defined(WOLFCRYPT_HAVE_SRP) \
|
||||
&& !defined(NO_SHA256) && !defined(WC_NO_RNG)
|
||||
if (ctx->srp != NULL) {
|
||||
XFREE(ctx->srp_password, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
ctx->srp_password = NULL;
|
||||
wc_SrpTerm(ctx->srp);
|
||||
XFREE(ctx->srp, ctx->heap, DYNAMIC_TYPE_SRP);
|
||||
ctx->srp = NULL;
|
||||
}
|
||||
#endif
|
||||
FreeSSL_Ctx(ctx);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user