mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
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.
This commit is contained in:
parent
ea6c5f03a5
commit
0d357155cc
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user