aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2011-10-06 20:30:34 +0200
committerYang Tse <yangsita@gmail.com>2011-10-06 20:30:34 +0200
commitb82bd05354cfa756a013d2bed4ffdc951ce903db (patch)
tree6ce79720ac2e00ee6287835b25c194cb77060a4d /lib
parent1958fe5745d8e7c3817108f614d319abc38a5f5f (diff)
multi.c: OOM handling fixes making torture tests 560 580 581 pass
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/multi.c b/lib/multi.c
index bf1f46764..0f7a24993 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1041,7 +1041,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
/* Add this handle to the send or pend pipeline */
easy->result = addHandleToSendOrPendPipeline(data,
easy->easy_conn);
- if(CURLE_OK == easy->result) {
+ if(CURLE_OK != easy->result)
+ disconnect_conn = TRUE;
+ else {
if(async)
/* We're now waiting for an asynchronous name lookup */
multistate(easy, CURLM_STATE_WAITRESOLVE);
@@ -1539,8 +1541,10 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
newurl = data->req.location;
data->req.location = NULL;
easy->result = Curl_follow(data, newurl, FOLLOW_FAKE);
- if(easy->result)
+ if(easy->result) {
+ disconnect_conn = TRUE;
free(newurl);
+ }
}
multistate(easy, CURLM_STATE_DONE);