libcurl: some OOM handling fixes

This commit is contained in:
Yang Tse
2011-10-07 20:50:57 +02:00
parent b82bd05354
commit 17f48fe879
13 changed files with 118 additions and 52 deletions

View File

@@ -504,9 +504,12 @@ void Curl_ssl_free_certinfo(struct SessionHandle *data)
struct curl_certinfo *ci = &data->info.certs;
if(ci->num_of_certs) {
/* free all individual lists used */
for(i=0; i<ci->num_of_certs; i++)
for(i=0; i<ci->num_of_certs; i++) {
curl_slist_free_all(ci->certinfo[i]);
ci->certinfo[i] = NULL;
}
free(ci->certinfo); /* free the actual array too */
ci->certinfo = NULL;
ci->num_of_certs = 0;
}
}