]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
schannel: properly close the certfile on error
authorx2018 <xkernel.wang@foxmail.com>
Fri, 31 Oct 2025 15:58:52 +0000 (23:58 +0800)
committerDaniel Stenberg <daniel@haxx.se>
Fri, 31 Oct 2025 22:27:06 +0000 (23:27 +0100)
Closes #19304

lib/vtls/schannel.c

index 55a99b3b437c39ba3a8e39fd859cb198a22bfa07..50b81f672590005999e1ec53653b841114ce49c8 100644 (file)
@@ -581,6 +581,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
             " for %s",
             blob ? "(memory blob)" : data->set.ssl.primary.clientcert);
       curlx_unicodefree(cert_path);
+      if(fInCert)
+        curlx_fclose(fInCert);
       return CURLE_SSL_CERTPROBLEM;
     }