summaryrefslogtreecommitdiff
path: root/lib/multi.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/multi.c')
-rw-r--r--lib/multi.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/multi.c b/lib/multi.c
index d5e09aab4..f20260977 100644
--- a/lib/multi.c
+++ b/lib/multi.c
@@ -1984,7 +1984,10 @@ static CURLMcode multi_runsingle(struct Curl_multi *multi,
else
follow = FOLLOW_RETRY;
result = multi_done(&data->easy_conn, CURLE_OK, FALSE);
- if(!result) {
+ if(result)
+ /* Curl_follow() would otherwise free this */
+ free(newurl);
+ else {
result = Curl_follow(data, newurl, follow);
if(!result) {
multistate(data, CURLM_STATE_CONNECT);