]> khamidou — GitHub mirrors - mojo.git/commitdiff
still struggling with this memory corruption error
authorkarim hamidou <khamidou@gmail.com>
Wed, 1 May 2013 14:54:13 +0000 (16:54 +0200)
committerkarim hamidou <khamidou@gmail.com>
Wed, 1 May 2013 14:54:13 +0000 (16:54 +0200)
interp.c
object.c

index 12eb65d64dc89b32a30853d465e43c95457c7df2..25902815c4d0dbc934924633447a352c9811cbd6 100644 (file)
--- 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);
index b47d326cbf905d0a2c461e6324f2c1b525580aa1..e79fd78713f96b505ad1481d1240f9df5084bc18 100644 (file)
--- 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);
 }