summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2020-07-12 00:45:27 +0200
committerDaniel Stenberg <daniel@haxx.se>2020-07-12 16:36:02 +0200
commit9466034561d55a0c43111c5c928ebef70ba95507 (patch)
tree2befb4a834189ba76e93dd93c516ae112623f8a4 /lib/transfer.c
parent81bf2713aef90b565c1284f9b7f4a9ac34f2401c (diff)
downloadcurl-9466034561d55a0c43111c5c928ebef70ba95507.tar.gz
transfer: fix memory-leak with CURLOPT_CURLU in a duped handle
Added test case 674 to reproduce and verify the bug report. Fixes #5665 Reported-by: NobodyXu on github Closes #5673
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 133a4783c..4b923744e 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1441,8 +1441,9 @@ CURLcode Curl_pretransfer(struct Curl_easy *data)
if(!data->change.url && data->set.uh) {
CURLUcode uc;
+ free(data->set.str[STRING_SET_URL]);
uc = curl_url_get(data->set.uh,
- CURLUPART_URL, &data->set.str[STRING_SET_URL], 0);
+ CURLUPART_URL, &data->set.str[STRING_SET_URL], 0);
if(uc) {
failf(data, "No URL set!");
return CURLE_URL_MALFORMAT;