aboutsummaryrefslogtreecommitdiff
path: root/src/util.c
diff options
context:
space:
mode:
authorame <[email protected]>2024-02-27 09:57:26 -0600
committerame <[email protected]>2024-02-27 09:57:26 -0600
commit559556dc6cb4bd025da4b6855f54162baab9b249 (patch)
treea088fa1d295f520f3b8094ef2a844241b46b461b /src/util.c
parent764dea6ddb8fb8f164858426d755afc33b3a2f1d (diff)
cookies, clean memeory
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;
}