Fix memory allocation / free bugs.
This commit is contained in:
parent
1438690b62
commit
dc9702df4c
|
@ -41,8 +41,7 @@ void _parser_extract_token_buffer(struct parser_state* state, char* buffer,
|
|||
}
|
||||
|
||||
int _parser_foreach_free_tree(void* data, va_list args) {
|
||||
libab_tree_free(data);
|
||||
free(data);
|
||||
libab_tree_free_recursive(data);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -1118,8 +1117,9 @@ libab_result _parse_expression(struct parser_state* state,
|
|||
result = LIBAB_UNEXPECTED;
|
||||
}
|
||||
|
||||
ll_free(&op_stack);
|
||||
ll_foreach(&op_stack, NULL, compare_always, _parser_foreach_free_tree);
|
||||
ll_foreach(&out_stack, NULL, compare_always, _parser_foreach_free_tree);
|
||||
ll_free(&op_stack);
|
||||
ll_free(&out_stack);
|
||||
|
||||
return result;
|
||||
|
|
Loading…
Reference in New Issue
Block a user