From 0da1356060365a42f3352ab87cd94e04a13aa963 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Tue, 17 Aug 2021 16:52:55 +0200 Subject: [PATCH] openssl: when creating a new context, there cannot be an old one Remove the previous handling that would call SSL_CTX_free(), and instead add an assert that halts a debug build if there ever is a context already set at this point. Closes #7585 --- lib/vtls/openssl.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index f6e6572d2e..2d17acf1bb 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -2658,8 +2658,7 @@ static CURLcode ossl_connect_step1(struct Curl_easy *data, return CURLE_SSL_CONNECT_ERROR; } - if(backend->ctx) - SSL_CTX_free(backend->ctx); + DEBUGASSERT(!backend->ctx); backend->ctx = SSL_CTX_new(req_method); if(!backend->ctx) { -- 2.47.2