libcurl: some OOM handling fixes
This commit is contained in:
13
lib/ssluse.c
13
lib/ssluse.c
@@ -810,18 +810,16 @@ struct curl_slist *Curl_ossl_engines_list(struct SessionHandle *data)
|
||||
{
|
||||
struct curl_slist *list = NULL;
|
||||
#if defined(USE_SSLEAY) && defined(HAVE_OPENSSL_ENGINE_H)
|
||||
struct curl_slist *beg = NULL;
|
||||
struct curl_slist *beg;
|
||||
ENGINE *e;
|
||||
|
||||
for(e = ENGINE_get_first(); e; e = ENGINE_get_next(e)) {
|
||||
list = curl_slist_append(list, ENGINE_get_id(e));
|
||||
if(list == NULL) {
|
||||
curl_slist_free_all(beg);
|
||||
beg = curl_slist_append(list, ENGINE_get_id(e));
|
||||
if(!beg) {
|
||||
curl_slist_free_all(list);
|
||||
return NULL;
|
||||
}
|
||||
else if(beg == NULL) {
|
||||
beg = list;
|
||||
}
|
||||
list = beg;
|
||||
}
|
||||
#endif
|
||||
(void) data;
|
||||
@@ -1859,6 +1857,7 @@ static CURLcode push_certinfo_len(struct SessionHandle *data,
|
||||
nl = curl_slist_append(ci->certinfo[certnum], output);
|
||||
if(!nl) {
|
||||
curl_slist_free_all(ci->certinfo[certnum]);
|
||||
ci->certinfo[certnum] = NULL;
|
||||
res = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
else
|
||||
|
Reference in New Issue
Block a user