Make "struct tree" contain the pointer to the tree buffer
[git/git.git] / fsck-objects.c
index 1922b6d..5e65df4 100644 (file)
@@ -198,17 +198,16 @@ static int fsck_tree(struct tree *item)
                        default:
                                break;
                        }
-                       free(last->name);
                        free(last);
                }
 
                last = entry;
        }
-       if (last) {
-               free(last->name);
+       if (last)
                free(last);
-       }
        item->entries = NULL;
+       free(item->buffer);
+       item->buffer = NULL;
 
        retval = 0;
        if (has_full_path) {