Reduce some code around frees

This commit is contained in:
Orestis Floros
2018-08-01 18:08:26 +03:00
parent 565d38c5af
commit 50880db2c5
7 changed files with 8 additions and 15 deletions

View File

@ -157,7 +157,7 @@ static long get_long(const char *identifier) {
// TODO move to a common util
static void clear_stack(void) {
for (int c = 0; c < 10; c++) {
if (stack[c].type == STACK_STR && stack[c].val.str != NULL)
if (stack[c].type == STACK_STR)
free(stack[c].val.str);
stack[c].identifier = NULL;
stack[c].val.str = NULL;