]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
schannel: fix potental memory leak of cert_store_path on four error paths
authorx2018 <xkernel.wang@foxmail.com>
Sun, 9 Nov 2025 14:20:24 +0000 (22:20 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Mon, 10 Nov 2025 08:14:56 +0000 (09:14 +0100)
Closes #19423

lib/vtls/schannel.c

index c96e0df77b50c4a1df3ad337f7d4ce3ad6e72615..639d6c384208f861d400510c289efacc07222b46 100644 (file)
@@ -580,6 +580,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
       failf(data, "schannel: certificate format compatibility error "
             " for %s",
             blob ? "(memory blob)" : data->set.ssl.primary.clientcert);
+      free(cert_store_path);
       curlx_unicodefree(cert_path);
       if(fInCert)
         curlx_fclose(fInCert);
@@ -597,6 +598,7 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
       int cert_find_flags;
       const char *cert_showfilename_error = blob ?
         "(memory blob)" : data->set.ssl.primary.clientcert;
+      free(cert_store_path);
       curlx_unicodefree(cert_path);
       if(fInCert) {
         long cert_tell = 0;