diff options
author | Preston Pan <preston@nullring.xyz> | 2023-01-08 19:17:57 -0800 |
---|---|---|
committer | Preston Pan <preston@nullring.xyz> | 2023-01-08 19:17:57 -0800 |
commit | 43f11a93385c4848bfad49510bdea2849f241816 (patch) | |
tree | aafe396ad077acc6be6bef1d77a65d517cd30cf4 /src/visitor.c | |
parent | 19367a27472a06634424e56c1eb21e4f53da4e9e (diff) |
add some frees; still need to fix high amounts of memory leakage
Diffstat (limited to 'src/visitor.c')
-rw-r--r-- | src/visitor.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/visitor.c b/src/visitor.c index bcea8e4..ffd6048 100644 --- a/src/visitor.c +++ b/src/visitor.c @@ -537,8 +537,8 @@ ast_t *eval_list(visitor_t *v, ast_t *e) { } stack_push(v->stack_frame, stack_frame); ast_t *res = eval_expr(v, function->cdr); - stack_pop(v->stack_frame); - hash_table_free_some(stack_frame); + hash_table_t *tmp = stack_pop(v->stack_frame); + hash_table_free_some(tmp); return res; } @@ -576,8 +576,7 @@ void eval_error(visitor_t *v, ast_t *e) { } void visitor_free(visitor_t *v) { - ast_free(v->root); - hash_table_free(v->eval_table); + hash_table_free_some(v->eval_table); stack_free(v->stack_frame); free(v); } |