mirror of
https://github.com/curl/curl.git
synced 2026-07-31 22:38:04 +03: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
1 changed files with 2 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue