schannel: properly close the certfile on error

Closes #19304
This commit is contained in:
x2018 2025-10-31 23:58:52 +08:00 committed by Daniel Stenberg
parent d4d7139e70
commit 27f55383fb
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View 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;
}