aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2014-10-02 23:22:01 +0200
committerDaniel Stenberg <daniel@haxx.se>2014-10-02 23:22:01 +0200
commit0d357155cc8b5132e33ee6d20b0a83aff872e58b (patch)
tree88043dd38ccd457dc5bde79486465775cc3b42c0 /lib
parentea6c5f03a50433be3c2acaabec1790c317448a2e (diff)
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.
Diffstat (limited to 'lib')
-rw-r--r--lib/multi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/multi.c b/lib/multi.c
index a1dc2c82c..7e7da682a 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -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;