]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
openssl: fix a potential memory leak of params.cert
authorx2018 <xkernel.wang@foxmail.com>
Mon, 17 Nov 2025 06:12:14 +0000 (14:12 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 17 Nov 2025 13:43:34 +0000 (14:43 +0100)
Closes #19560

lib/vtls/openssl.c

index 72ca0f6cb38ba49a12691a20d02876f550c5297e..9b3ca9b5eaecc264e476200d2f22bb86e11c44d2 100644 (file)
@@ -1214,6 +1214,7 @@ static int engineload(struct Curl_easy *data,
       failf(data, "unable to set client certificate [%s]",
             ossl_strerror(ERR_get_error(), error_buffer,
                           sizeof(error_buffer)));
+      X509_free(params.cert);
       return 0;
     }
     X509_free(params.cert); /* we do not need the handle any more... */