Skip to content

Commit

Permalink
multi_runsingle: fix memory leak
Browse files Browse the repository at this point in the history
Coverity CID 1202837. There's a potential risk that 'newurl' gets
overwritten when it was already pointing to allocated memory.
  • Loading branch information
bagder committed Oct 2, 2014
1 parent ea6c5f0 commit 0d35715
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/multi.c
Expand Up @@ -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;
Expand Down

0 comments on commit 0d35715

Please sign in to comment.