From: karim hamidou Date: Wed, 1 May 2013 14:54:13 +0000 (+0200) Subject: still struggling with this memory corruption error X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0144e59a9133a05f963b75e4ea0c033dafebcbc1;p=mojo.git still struggling with this memory corruption error --- 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); }