add: error appropriately on repository with no commits
[gitweb.git] / builtin / fsck.c
index 46f6ea9baa909bf5aeec43a08461ad2328d5eb13..bb4227bebc606dfac8337d7aa3e78705113a79b5 100644 (file)
@@ -402,7 +402,8 @@ static int fsck_obj(struct object *obj, void *buffer, unsigned long size)
        if (obj->type == OBJ_TREE)
                free_tree_buffer((struct tree *)obj);
        if (obj->type == OBJ_COMMIT)
-               free_commit_buffer((struct commit *)obj);
+               free_commit_buffer(the_repository->parsed_objects,
+                                  (struct commit *)obj);
        return err;
 }