Skip to content

Commit

Permalink
initialize cap and size of node_list for safety
Browse files Browse the repository at this point in the history
  • Loading branch information
alissonbrunosa committed Jul 2, 2024
1 parent 800fd09 commit a610877
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions c/parser.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,9 @@ static struct node_list* create_node_list() {
exit(1);
}

list->size = 0;
list->capacity = 0;
list->items = NULL;
return list;
}

Expand Down

0 comments on commit a610877

Please sign in to comment.