Curl_follow: Always free the passed new URL

Closes #3124
This commit is contained in:
Michael Kaufmann 2018-10-10 22:53:50 +02:00
parent 3455b4b374
commit 6afe70a00b
2 changed files with 4 additions and 1 deletions

View file

@ -1725,6 +1725,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(!drc || (drc == CURLE_SEND_ERROR)) {
follow = FOLLOW_RETRY;
drc = Curl_follow(data, newurl, follow);
newurl = NULL; /* freed by Curl_follow() */
if(!drc) {
multistate(data, CURLM_STATE_CONNECT);
rc = CURLM_CALL_MULTI_PERFORM;