mirror of
https://github.com/curl/curl.git
synced 2026-08-25 07:23:31 +03:00
libcurl: some OOM handling fixes
This commit is contained in:
parent
b82bd05354
commit
17f48fe879
13 changed files with 118 additions and 52 deletions
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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue