mirror of
https://github.com/curl/curl.git
synced 2025-04-24 16:40:32 +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(!retry) {
|
||||||
/* if the URL is a follow-location and not just a retried request
|
/* if the URL is a follow-location and not just a retried request
|
||||||
then figure out the URL here */
|
then figure out the URL here */
|
||||||
|
if(newurl)
|
||||||
|
free(newurl);
|
||||||
newurl = data->req.newurl;
|
newurl = data->req.newurl;
|
||||||
data->req.newurl = NULL;
|
data->req.newurl = NULL;
|
||||||
follow = FOLLOW_REDIR;
|
follow = FOLLOW_REDIR;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user