aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/util.c')
-rw-r--r--src/util.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/util.c b/src/util.c
index 4ba0476..f1b9881 100644
--- a/src/util.c
+++ b/src/util.c
@@ -27,8 +27,11 @@ int gen_parse(char* inp, int len, parray_t** _table){
state = 0;
} else if(current->c[0] != '\0' || inp[i] != ' ') str_pushl(current, inp + i, 1);
}
- parray_set(table, last->c, (void*)current);
- str_free(last);
+
+ if(last != NULL){
+ parray_set(table, last->c, (void*)current);
+ str_free(last);
+ }
*_table = table;
return 1;
}