summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-29 11:32:07 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-29 11:34:00 +0200
commitf7071fe2df1a4f3f4ebb2b23b43cd0c80b8fd6e4 (patch)
tree5d0050771e06921c93f8298c45d0e30fc0ace477
parent454fa3fd7be9b4a8d51d19d3515a3a935c3bf400 (diff)
downloadcurl-bagder/missing-multi-done.tar.gz
multi: fix memory leak in content encoding related error pathbagder/missing-multi-done
... a missing multi_done() call. Credit to OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10728
-rw-r--r--lib/multi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/multi.c b/lib/multi.c
index f20260977..9a98435e6 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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)