mirror of
https://github.com/moparisthebest/curl
synced 2024-08-13 17:03:50 -04:00
proxy: fixed a memory leak on OOM
This commit is contained in:
parent
c6ddb606d8
commit
ce9ba3ba10
@ -5118,15 +5118,19 @@ static CURLcode parse_proxy(struct Curl_easy *data,
|
|||||||
with reserved characters like ':' in them. */
|
with reserved characters like ':' in them. */
|
||||||
Curl_safefree(proxyinfo->user);
|
Curl_safefree(proxyinfo->user);
|
||||||
proxyinfo->user = curl_easy_unescape(data, proxyuser, 0, NULL);
|
proxyinfo->user = curl_easy_unescape(data, proxyuser, 0, NULL);
|
||||||
|
Curl_safefree(proxyuser);
|
||||||
|
|
||||||
if(!proxyinfo->user)
|
if(!proxyinfo->user) {
|
||||||
|
Curl_safefree(proxypasswd);
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
}
|
||||||
|
|
||||||
Curl_safefree(proxyinfo->passwd);
|
Curl_safefree(proxyinfo->passwd);
|
||||||
if(proxypasswd && strlen(proxypasswd) < MAX_CURL_PASSWORD_LENGTH)
|
if(proxypasswd && strlen(proxypasswd) < MAX_CURL_PASSWORD_LENGTH)
|
||||||
proxyinfo->passwd = curl_easy_unescape(data, proxypasswd, 0, NULL);
|
proxyinfo->passwd = curl_easy_unescape(data, proxypasswd, 0, NULL);
|
||||||
else
|
else
|
||||||
proxyinfo->passwd = strdup("");
|
proxyinfo->passwd = strdup("");
|
||||||
|
Curl_safefree(proxypasswd);
|
||||||
|
|
||||||
if(!proxyinfo->passwd)
|
if(!proxyinfo->passwd)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
Loading…
Reference in New Issue
Block a user