]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
tool_getparam: fix memory leak in parse_args
authorJay Satiro <raysatiro@yahoo.com>
Tue, 9 Jun 2020 15:49:44 +0000 (11:49 -0400)
committerJay Satiro <raysatiro@yahoo.com>
Tue, 9 Jun 2020 15:49:44 +0000 (11:49 -0400)
Prior to this change in Windows Unicode builds most parsed options would
not be freed.

Found using _CrtDumpMemoryLeaks().

Ref: https://github.com/curl/curl/issues/5545

src/tool_getparam.c

index ab2b75289beac185094da017f1b76ba72e53fd74..bd989fada90a859b3f268d7b9effc3e45ad8bcfc 100644 (file)
@@ -2302,6 +2302,8 @@ ParameterError parse_args(struct GlobalConfig *global, int argc,
       result = getparameter("--url", orig_opt, &used, global,
                             config);
     }
+
+    curlx_unicodefree(orig_opt);
   }
 
   if(result && result != PARAM_HELP_REQUESTED &&