mirror of
https://github.com/curl/curl.git
synced 2026-07-23 18:57:18 +03:00
schannel: fix memory leak
- Do not leak memory on failed setting algorithm cipher list. Discovered by ZeroPath. - Do not free backend->cred after failed AcquireCredentialsHandle. backend->cred is always freed later, during cleanup. Closes https://github.com/curl/curl/pull/19118
This commit is contained in:
parent
e779650a86
commit
66e3ff5d0e
1 changed files with 2 additions and 1 deletions
|
|
@ -818,6 +818,8 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
|
|||
result = set_ssl_ciphers(&schannel_cred, ciphers, algIds);
|
||||
if(result) {
|
||||
failf(data, "schannel: Failed setting algorithm cipher list");
|
||||
if(client_certs[0])
|
||||
CertFreeCertificateContext(client_certs[0]);
|
||||
return result;
|
||||
}
|
||||
}
|
||||
|
|
@ -845,7 +847,6 @@ schannel_acquire_credential_handle(struct Curl_cfilter *cf,
|
|||
char buffer[STRERROR_LEN];
|
||||
failf(data, "schannel: AcquireCredentialsHandle failed: %s",
|
||||
Curl_sspi_strerror(sspi_status, buffer, sizeof(buffer)));
|
||||
Curl_safefree(backend->cred);
|
||||
switch(sspi_status) {
|
||||
case SEC_E_INSUFFICIENT_MEMORY:
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue