aboutsummaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2017-05-23 10:32:18 +0200
committerDaniel Stenberg <daniel@haxx.se>2017-05-23 23:27:58 +0200
commitbba59073c52e6dd00ddc18e0e40d1f7dfc1c9315 (patch)
tree975b55b3373139d9120f6f23a0217bbeefe36891 /lib/multi.c
parent48f2a96a609aec535736a7fe202163fdb2a99fd5 (diff)
redirect: store the "would redirect to" URL when max redirs is reached
Test 1261 added to verify. Reported-by: Lloyd Fournier Fixes #1489 Closes #1497
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/multi.c b/lib/multi.c
index 09be44396..4b2872743 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1715,20 +1715,18 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
else {
/* Follow failed */
result = drc;
- free(newurl);
}
}
else {
/* done didn't return OK or SEND_ERROR */
result = drc;
- free(newurl);
}
}
else {
/* Have error handler disconnect conn if we can't retry */
stream_error = TRUE;
- free(newurl);
}
+ free(newurl);
}
else {
/* failure detected */
@@ -1963,9 +1961,6 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
if(!result) {
multistate(data, CURLM_STATE_CONNECT);
rc = CURLM_CALL_MULTI_PERFORM;
- newurl = NULL; /* handed over the memory ownership to
- Curl_follow(), make sure we don't free() it
- here */
}
}
}
@@ -1979,9 +1974,7 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
newurl = data->req.location;
data->req.location = NULL;
result = Curl_follow(data, newurl, FOLLOW_FAKE);
- if(!result)
- newurl = NULL; /* allocation was handed over Curl_follow() */
- else
+ if(result)
stream_error = TRUE;
}