From 8de898414c422ed56980dd4ac3a0125bc6fec5c5 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Sat, 18 Oct 2025 12:11:09 +0200 Subject: [PATCH] openssl: free UI_METHOD on exit path 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 | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/vtls/openssl.c b/lib/vtls/openssl.c index 2868ea85ec..66c0fbfabd 100644 --- a/lib/vtls/openssl.c +++ b/lib/vtls/openssl.c @@ -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) { -- 2.47.3