]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: free UI_METHOD on exit path
authorDaniel Stenberg <daniel@haxx.se>
Sat, 18 Oct 2025 10:11:09 +0000 (12:11 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 18 Oct 2025 10:54:19 +0000 (12:54 +0200)
In providercheck(), when failing to open the "store", the exit path
would not previously free the created UI_METHOD and instead leak this
resource.

Pointed out by ZeroPath

Closes #19114

lib/vtls/openssl.c

index 2868ea85ec09094b47e447a9bddda8b8c7a81d3d..66c0fbfabdaaaa6d05255007a3f1083ee0b7f1c8 100644 (file)
@@ -1328,6 +1328,7 @@ static int providercheck(struct Curl_easy *data,
       failf(data, "Failed to open OpenSSL store: %s",
             ossl_strerror(ERR_get_error(), error_buffer,
                           sizeof(error_buffer)));
+      UI_destroy_method(ui_method);
       return 0;
     }
     if(OSSL_STORE_expect(store, OSSL_STORE_INFO_PKEY) != 1) {