summaryrefslogtreecommitdiff
path: root/lib/transfer.c
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2018-09-24 14:05:24 +0200
committerDaniel Stenberg <daniel@haxx.se>2018-09-24 16:38:11 +0200
commitef695fc30144c8b92700c0161cdafd141c70ae60 (patch)
tree65e869f6995bd24c8398a042e110f991028dbcc3 /lib/transfer.c
parente2dd435d473cdc97785df95d032276fafb4b7746 (diff)
downloadcurl-ef695fc30144c8b92700c0161cdafd141c70ae60.tar.gz
Curl_retry_request: fix memory leak
Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10648 Closes #3042
Diffstat (limited to 'lib/transfer.c')
-rw-r--r--lib/transfer.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/transfer.c b/lib/transfer.c
index 6a80bf31a..efd929279 100644
--- a/lib/transfer.c
+++ b/lib/transfer.c
@@ -1705,8 +1705,13 @@ CURLcode Curl_retry_request(struct connectdata *conn,
if(conn->handler->protocol&PROTO_FAMILY_HTTP) {
struct HTTP *http = data->req.protop;
- if(http->writebytecount)
- return Curl_readrewind(conn);
+ if(http->writebytecount) {
+ CURLcode result = Curl_readrewind(conn);
+ if(result) {
+ Curl_safefree(*url);
+ return result;
+ }
+ }
}
}
return CURLE_OK;