From ecedca8a95b2342d140892a97ccde935bdaa7f1c Mon Sep 17 00:00:00 2001 From: James Booth Date: Tue, 17 Jun 2014 22:30:51 +0100 Subject: [PATCH] Free tokens when 0 supplied an 0 min, parse_args_with_freetext --- src/tools/parser.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/tools/parser.c b/src/tools/parser.c index ea8e1da0..bd2a76f0 100644 --- a/src/tools/parser.c +++ b/src/tools/parser.c @@ -278,6 +278,7 @@ parse_args_with_freetext(const char * const inp, int min, int max, gboolean *res // if min allowed is 0 and 0 found, return empty char* array } else if (min == 0 && num == 0) { + g_slist_free_full(tokens, free); gchar **args = malloc((num + 1) * sizeof(*args)); args[0] = NULL; *result = TRUE;