about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorJames Booth <boothj5@gmail.com>2014-06-17 22:30:51 +0100
committerJames Booth <boothj5@gmail.com>2014-06-17 22:30:51 +0100
commitecedca8a95b2342d140892a97ccde935bdaa7f1c (patch)
tree96b1c2239bfa5e0e1f806fbafd155c80bbe2496a
parentacc4a00d785e93b4eba8d18cc9ba86da0d6635d3 (diff)
downloadprofani-tty-ecedca8a95b2342d140892a97ccde935bdaa7f1c.tar.gz
Free tokens when 0 supplied an 0 min, parse_args_with_freetext
-rw-r--r--src/tools/parser.c1
1 files changed, 1 insertions, 0 deletions
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;