Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-16 01:55:41 +0300
committerJunio C Hamano <gitster@pobox.com>2018-02-16 01:55:41 +0300
commit52b7ab31d08d3e29870f7085c64de936e109f05d (patch)
treef5d33da660c35c36d8728a6ab700671bbaa92efa
parentae0d0795d736467202d9bfd535942be81529f84e (diff)
parentba3a08ca0ec0d800d2fdbe73984927c1d8199082 (diff)
Merge branch 'jt/fsck-code-cleanup'
Plug recently introduced leaks in fsck. * jt/fsck-code-cleanup: fsck: fix leak when traversing trees
-rw-r--r--builtin/fsck.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 7a8a679d4f..9981db2263 100644
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
@@ -180,7 +180,13 @@ static void mark_object_reachable(struct object *obj)
static int traverse_one_object(struct object *obj)
{
- return fsck_walk(obj, obj, &fsck_walk_options);
+ int result = fsck_walk(obj, obj, &fsck_walk_options);
+
+ if (obj->type == OBJ_TREE) {
+ struct tree *tree = (struct tree *)obj;
+ free_tree_buffer(tree);
+ }
+ return result;
}
static int traverse_reachable(void)