]> granicus.if.org Git - curl/commitdiff
multi.c: OOM handling fix
authorYang Tse <yangsita@gmail.com>
Fri, 21 Dec 2012 18:48:07 +0000 (19:48 +0100)
committerYang Tse <yangsita@gmail.com>
Fri, 21 Dec 2012 18:48:07 +0000 (19:48 +0100)
lib/multi.c

index a1dd70513df71f04b9fe713747435ef7501cfb2a..2905a1346d89397920b2f6499b3f4f48be0d1066 100644 (file)
@@ -1616,8 +1616,9 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
             newurl = data->req.location;
             data->req.location = NULL;
             easy->result = Curl_follow(data, newurl, FOLLOW_FAKE);
-            newurl = NULL; /* allocation was handed over */
-            if(easy->result)
+            if(CURLE_OK == easy->result)
+              newurl = NULL; /* allocation was handed over Curl_follow() */
+            else
               disconnect_conn = TRUE;
           }