]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: when creating a new context, there cannot be an old one
authorDaniel Stenberg <daniel@haxx.se>
Tue, 17 Aug 2021 14:52:55 +0000 (16:52 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Wed, 18 Aug 2021 12:11:45 +0000 (14:11 +0200)
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

index f6e6572d2e444dbe7aa715da7b44b9299b57322b..2d17acf1bb4c2c468f58a8b1f75e6c52f0d3752e 100644 (file)
@@ -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) {