summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2002-05-02 22:12:14 +0000
committerDaniel Stenberg <daniel@haxx.se>2002-05-02 22:12:14 +0000
commit2db0744a7bf18bd85061d1f3b050368ed4fbe32f (patch)
tree43b617015435b56cea0cf14016e0e30bfef656c6
parent2de00283495677728941a820597f9fdc2e1d4e27 (diff)
downloadgnurl-2db0744a7bf18bd85061d1f3b050368ed4fbe32f.tar.gz
gnurl-2db0744a7bf18bd85061d1f3b050368ed4fbe32f.tar.bz2
gnurl-2db0744a7bf18bd85061d1f3b050368ed4fbe32f.zip
return CURLM_CALL_MULTI_PERFORM in one more case, and check return code
from malloc()
-rw-r--r--lib/multi.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index a1111ccd5..47bf1c005 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -323,6 +323,10 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
{
struct Curl_message *msg = (struct Curl_message *)
malloc(sizeof(struct Curl_message));
+
+ if(!msg)
+ return CURLM_OUT_OF_MEMORY;
+
msg->extmsg.msg = CURLMSG_DONE;
msg->extmsg.easy_handle = easy->easy_handle;
msg->extmsg.data.result = easy->result;
@@ -339,7 +343,9 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
multi->num_msgs++; /* increase message counter */
}
+ result = CURLM_CALL_MULTI_PERFORM;
break;
+
case CURLM_STATE_COMPLETED:
/* this is a completed transfer, it is likely to still be connected */
@@ -364,6 +370,7 @@ CURLMcode curl_multi_perform(CURLM *multi_handle, int *running_handles)
easy = easy->next; /* operate on next handle */
}
+
return result;
}