]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_operate: fix mem leak when failed config parse
authorJay Satiro <raysatiro@yahoo.com>
Sun, 29 Dec 2019 19:18:48 +0000 (14:18 -0500)
committerJay Satiro <raysatiro@yahoo.com>
Sun, 29 Dec 2019 19:18:48 +0000 (14:18 -0500)
Found by fuzzing the config file.

Reported-by: Geeknik Labs
Fixes https://github.com/curl/curl/issues/4767

src/tool_operate.c

index d4f170e333829678e16be2fc517f84a747fcfa57..61b13067238e7bf3b4252c25c4efb8dc943808a1 100644 (file)
@@ -720,8 +720,10 @@ static CURLcode single_transfer(struct GlobalConfig *global,
       if(SetHTTPrequest(config, HTTPREQ_SIMPLEPOST, &config->httpreq))
         result = CURLE_FAILED_INIT;
     }
-    if(result)
+    if(result) {
+      single_transfer_cleanup(config);
       return result;
+    }
   }
   if(!state->urlnode) {
     /* first time caller, setup things */