From 43f11a93385c4848bfad49510bdea2849f241816 Mon Sep 17 00:00:00 2001 From: Preston Pan Date: Sun, 8 Jan 2023 19:17:57 -0800 Subject: add some frees; still need to fix high amounts of memory leakage --- src/visitor.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/visitor.c') 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); } -- cgit