From: Daniel Stenberg Date: Fri, 28 Sep 2018 08:58:28 +0000 (+0200) Subject: multi: fix location URL memleak in error path X-Git-Tag: curl-7_62_0~129 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=454fa3fd7be9b4a8d51d19d3515a3a935c3bf400;p=curl multi: fix location URL memleak in error path Follow-up to #3044 - fix a leak OSS-Fuzz detected Closes #3057 --- diff --git a/lib/multi.c b/lib/multi.c index d5e09aab4..f20260977 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1984,7 +1984,10 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, else follow = FOLLOW_RETRY; result = multi_done(&data->easy_conn, CURLE_OK, FALSE); - if(!result) { + if(result) + /* Curl_follow() would otherwise free this */ + free(newurl); + else { result = Curl_follow(data, newurl, follow); if(!result) { multistate(data, CURLM_STATE_CONNECT);