summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorMichael Kaufmann <mail@michael-kaufmann.ch>2018-10-10 22:53:50 +0200
committerMichael Kaufmann <mail@michael-kaufmann.ch>2018-10-13 13:18:51 +0200
commit6afe70a00bb4018810d8f4417bc49b44a7998e46 (patch)
tree9eb1e46ffd6a4c65f67533315c8abbc30cc829e4 /lib/transfer.c
parent3455b4b374609b46bee9c066962eb416f325769b (diff)
downloadcurl-6afe70a00bb4018810d8f4417bc49b44a7998e46.tar.gz
Curl_follow: Always free the passed new URL
Closes #3124
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 638ae9ec5..2a348b687 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1500,8 +1500,10 @@ CURLcode Curl_follow(struct Curl_easy *data,
}
data->change.referer = strdup(data->change.url);
- if(!data->change.referer)
+ if(!data->change.referer) {
+ free(newurl);
return CURLE_OUT_OF_MEMORY;
+ }
data->change.referer_alloc = TRUE; /* yes, free this later */
}
}