OOM handling/cleanup slight adjustments

This commit is contained in:
Yang Tse 2011-10-11 19:41:30 +02:00
parent a84b8a3922
commit 584dc8b8af
7 changed files with 38 additions and 21 deletions

View file

@ -1855,6 +1855,7 @@ static CURLcode push_certinfo_len(struct SessionHandle *data,
equivalent of curl_slist_append but doesn't strdup() the given data as
like in this place the extra malloc/free is totally pointless */
nl = curl_slist_append(ci->certinfo[certnum], output);
free(output);
if(!nl) {
curl_slist_free_all(ci->certinfo[certnum]);
ci->certinfo[certnum] = NULL;
@ -1863,8 +1864,6 @@ static CURLcode push_certinfo_len(struct SessionHandle *data,
else
ci->certinfo[certnum] = nl;
free(output);
return res;
}