[PATCH (3.4)] value-pairs: Fix the error handling in the command-line parser.
When an error occurs during command-line parsing, do not attempt to free argv: it's not owned by us anymore. Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- lib/value-pairs.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-) diff --git a/lib/value-pairs.c b/lib/value-pairs.c index fcaa401..c58d294 100644 --- a/lib/value-pairs.c +++ b/lib/value-pairs.c @@ -465,7 +465,6 @@ value_pairs_new_from_cmdline (GlobalConfig *cfg, { value_pairs_free (vp); g_option_context_free (ctx); - g_free (argv); return NULL; } g_option_context_free (ctx); -- 1.7.7.3
applied to 3.4, thanks Gergely. On Fri, 2011-11-18 at 17:19 +0100, Gergely Nagy wrote:
When an error occurs during command-line parsing, do not attempt to free argv: it's not owned by us anymore.
Signed-off-by: Gergely Nagy <algernon@balabit.hu> --- lib/value-pairs.c | 1 - 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib/value-pairs.c b/lib/value-pairs.c index fcaa401..c58d294 100644 --- a/lib/value-pairs.c +++ b/lib/value-pairs.c @@ -465,7 +465,6 @@ value_pairs_new_from_cmdline (GlobalConfig *cfg, { value_pairs_free (vp); g_option_context_free (ctx); - g_free (argv); return NULL; } g_option_context_free (ctx);
-- Bazsi
participants (2)
-
Balazs Scheidler
-
Gergely Nagy