From 0144e59a9133a05f963b75e4ea0c033dafebcbc1 Mon Sep 17 00:00:00 2001 From: karim hamidou Date: Wed, 1 May 2013 16:54:13 +0200 Subject: [PATCH] still struggling with this memory corruption error --- interp.c | 4 ++-- object.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/interp.c b/interp.c index 12eb65d..2590281 100644 --- a/interp.c +++ b/interp.c @@ -26,8 +26,8 @@ int compile_image(FILE *fp) { while(!feof(fp)) { - struct Object* ast = clone_object(list_object); - struct Object* scope = clone_object(list_object); + struct Object* ast = create_list_object(); // clone_object(list_object); + struct Object* scope = create_list_object(); //clone_object(list_object); expression(ast); display_ast(ast, 0); diff --git a/object.c b/object.c index b47d326..e79fd78 100644 --- a/object.c +++ b/object.c @@ -121,8 +121,10 @@ void free_object(struct Object *o) if (o->type == T_LIST && o->value.l_value != NULL) { mojo_list_free(o->value.l_value); + free(o->value.l_value); } + free(o); } -- 2.43.0