From: Daniel Stenberg Date: Tue, 17 Aug 2021 14:52:55 +0000 (+0200) Subject: openssl: when creating a new context, there cannot be an old one X-Git-Tag: curl-7_79_0~93 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0da1356060365a42f3352ab87cd94e04a13aa963;p=thirdparty%2Fcurl.git 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 --- 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) {