From c8e7a57b4c177c19d9289e0c5db76a720c9a1e16 Mon Sep 17 00:00:00 2001 From: Andrey Volk Date: Wed, 20 Jan 2021 22:31:35 +0300 Subject: [PATCH] [Unit-Tests] Fix leak of arg in the case of an error in fct_clp__parse() --- src/include/test/switch_fct.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/include/test/switch_fct.h b/src/include/test/switch_fct.h index a9b3595d0e..f88821b49c 100644 --- a/src/include/test/switch_fct.h +++ b/src/include/test/switch_fct.h @@ -1716,6 +1716,12 @@ fct_clp__parse(fct_clp_t *clp, int argc, char const *argv[]) arg =NULL; } } + + if (arg != NULL) + { + free(arg); + arg = NULL; + } }