From: x2018 Date: Sun, 9 Nov 2025 14:20:24 +0000 (+0800) Subject: schannel: fix potental memory leak of cert_store_path on four error paths X-Git-Tag: rc-8_18_0-1~378 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=baafa5ff7664230ac4475dc9227e842cc09c8151;p=thirdparty%2Fcurl.git schannel: fix potental memory leak of cert_store_path on four error paths Closes #19423 --- diff --git a/lib/vtls/schannel.c b/lib/vtls/schannel.c index c96e0df77b..639d6c3842 100644 --- a/lib/vtls/schannel.c +++ b/lib/vtls/schannel.c @@ -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;