diff options
author | Yang Tse <yangsita@gmail.com> | 2013-07-12 12:16:48 +0200 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2013-07-12 12:17:31 +0200 |
commit | 83f0dae1292b8b9b2507457db6b3ab22ba31c64b (patch) | |
tree | f3fbbed7c96f2efb64849c80cfa29b406c5e6937 /lib | |
parent | 65d53cf6ef11612603236418d579177b6a149915 (diff) |
url.c: fix parse_login_details() OOM handling
Diffstat (limited to 'lib')
-rw-r--r-- | lib/url.c | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -4565,15 +4565,20 @@ static CURLcode parse_login_details(const char *login, const size_t len, /* Allocate the password portion buffer */ if(!result && passwdp && plen) { pbuf = malloc(plen + 1); - if(!pbuf) + if(!pbuf) { + Curl_safefree(ubuf); result = CURLE_OUT_OF_MEMORY; + } } /* Allocate the options portion buffer */ if(!result && optionsp && olen) { obuf = malloc(olen + 1); - if(!obuf) + if(!obuf) { + Curl_safefree(pbuf); + Curl_safefree(ubuf); result = CURLE_OUT_OF_MEMORY; + } } if(!result) { |