Commit 0d357155 authored by Daniel Stenberg's avatar Daniel Stenberg
Browse files

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.
parent ea6c5f03
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -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;