mirror of
https://github.com/curl/curl.git
synced 2026-07-23 13:57:19 +03:00
url: fix memory leak if OOM in the HSTS handling
Reported-by: Viktor Szakats Bug: https://github.com/curl/curl/pull/6627#issuecomment-781626205 Closes #6628
This commit is contained in:
parent
e06fa7462a
commit
d25c479e84
1 changed files with 3 additions and 1 deletions
|
|
@ -1959,8 +1959,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||
if(uc)
|
||||
return Curl_uc_to_curlcode(uc);
|
||||
uc = curl_url_get(uh, CURLUPART_SCHEME, &data->state.up.scheme, 0);
|
||||
if(uc)
|
||||
if(uc) {
|
||||
free(url);
|
||||
return Curl_uc_to_curlcode(uc);
|
||||
}
|
||||
data->change.url = url;
|
||||
data->change.url_alloc = TRUE;
|
||||
infof(data, "Switched from HTTP to HTTPS due to HSTS => %s\n",
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue