From: Daniel Stenberg Date: Thu, 2 Oct 2014 21:22:01 +0000 (+0200) Subject: multi_runsingle: fix memory leak X-Git-Tag: curl-7_39_0~195 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0d357155cc8b5132e33ee6d20b0a83aff872e58b;p=thirdparty%2Fcurl.git multi_runsingle: fix memory leak Coverity CID 1202837. There's a potential risk that 'newurl' gets overwritten when it was already pointing to allocated memory. --- diff --git a/lib/multi.c b/lib/multi.c index a1dc2c82c9..7e7da682a9 100644 --- a/lib/multi.c +++ b/lib/multi.c @@ -1590,6 +1590,8 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi, if(!retry) { /* if the URL is a follow-location and not just a retried request then figure out the URL here */ + if(newurl) + free(newurl); newurl = data->req.newurl; data->req.newurl = NULL; follow = FOLLOW_REDIR;