]> granicus.if.org Git - curl/commitdiff
multi: fix memory leak in content encoding related error path
authorDaniel Stenberg <daniel@haxx.se>
Sat, 29 Sep 2018 09:32:07 +0000 (11:32 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 29 Sep 2018 13:03:57 +0000 (15:03 +0200)
... a missing multi_done() call.

Credit to OSS-Fuzz
Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10728
Closes #3063

lib/multi.c

index f2026097785d358b945765047cae24258f8aece2..9a98435e6f02f23b97a4b6e6f48a13065073ae93 100644 (file)
@@ -2005,12 +2005,16 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
             newurl = data->req.location;
             data->req.location = NULL;
             result = Curl_follow(data, newurl, FOLLOW_FAKE);
-            if(result)
+            if(result) {
               stream_error = TRUE;
+              result = multi_done(&data->easy_conn, result, TRUE);
+            }
           }
 
-          multistate(data, CURLM_STATE_DONE);
-          rc = CURLM_CALL_MULTI_PERFORM;
+          if(!result) {
+            multistate(data, CURLM_STATE_DONE);
+            rc = CURLM_CALL_MULTI_PERFORM;
+          }
         }
       }
       else if(comeback)