summaryrefslogtreecommitdiff
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 14:07:29 +0200
commitccb98bb7095571e81f0fba0f74a1c7be74af3301 (patch)
tree811fdaa01324074db8dd5cd937776c5552017e20
parentb939bc47b27cd57c6ebb852ad653933e4124b452 (diff)
downloadcurl-bagder/fuzzer-leak.tar.gz
Curl_retry_request: fix memory leakbagder/fuzzer-leak
Detected by OSS-Fuzz Bug: https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=10648
-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;