diff options
| author | ame <[email protected]> | 2024-02-27 09:57:26 -0600 |
|---|---|---|
| committer | ame <[email protected]> | 2024-02-27 09:57:26 -0600 |
| commit | 2cc619311a5a14d79b9736ecdac4357986fdea92 (patch) | |
| tree | a088fa1d295f520f3b8094ef2a844241b46b461b /src/util.c | |
| parent | d6eff6de364890153baa1c7d68d8b72c27df1b9b (diff) | |
cookies, clean memeory
Diffstat (limited to 'src/util.c')
| -rw-r--r-- | src/util.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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; } |
