1
0
mirror of https://github.com/moparisthebest/curl synced 2024-11-12 04:25:08 -05:00

curl_multi_wait: OOM handling fix

This commit is contained in:
Yang Tse 2012-12-23 21:10:45 +01:00
parent a1fc9b80c8
commit 7a09907146

View File

@ -929,8 +929,11 @@ CURLMcode curl_multi_wait(CURLM *multi_handle,
easy = easy->next; /* check next handle */
}
if(nfds)
ufds = (struct pollfd *)malloc(nfds * sizeof(struct pollfd));
if(nfds) {
ufds = malloc(nfds * sizeof(struct pollfd));
if(!ufds)
return CURLM_OUT_OF_MEMORY;
}
nfds = 0;
/* Add the curl handles to our pollfds first */