diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2017-02-25 21:36:39 +0100 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2017-02-25 21:36:39 +0100 |
commit | ce9ba3ba1057725fe5f485de01294182841c2132 (patch) | |
tree | 47eaa8532ebcf3be163d32ecb2b506458f9948bf /lib | |
parent | c6ddb606d8a3fdbe89763f7299e7f43cf6581567 (diff) |
proxy: fixed a memory leak on OOM
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -5118,15 +5118,19 @@ static CURLcode parse_proxy(struct Curl_easy *data, with reserved characters like ':' in them. */ Curl_safefree(proxyinfo->user); 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; + } Curl_safefree(proxyinfo->passwd); if(proxypasswd && strlen(proxypasswd) < MAX_CURL_PASSWORD_LENGTH) proxyinfo->passwd = curl_easy_unescape(data, proxypasswd, 0, NULL); else proxyinfo->passwd = strdup(""); + Curl_safefree(proxypasswd); if(!proxyinfo->passwd) return CURLE_OUT_OF_MEMORY; |