cleanup tokens correctly
This commit is contained in:
parent
75a98858cd
commit
d8c36904b6
1 changed files with 4 additions and 1 deletions
5
lapis.c
5
lapis.c
|
@ -677,7 +677,10 @@ lapis_node_t *lapis_parse_expr(int64_t *nnodes, FILE *f) {
|
|||
*nnodes = num_nodes;
|
||||
return nodes;
|
||||
ERROR:
|
||||
if ( tokens != NULL ) free( tokens );
|
||||
if ( tokens != NULL ) {
|
||||
for (size_t n=0; n < ntokens; n++) lapis_token_free(&tokens[n]);
|
||||
free(tokens);
|
||||
}
|
||||
if ( oper_priorities != NULL ) free( oper_priorities );
|
||||
if ( oper_arg_form != NULL ) free( oper_arg_form );
|
||||
if ( nodes != NULL ) free( nodes );
|
||||
|
|
Loading…
Reference in a new issue