diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-15 14:55:41 -0800 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-15 14:55:41 -0800 |
commit | 52b7ab31d08d3e29870f7085c64de936e109f05d (patch) | |
tree | f5d33da660c35c36d8728a6ab700671bbaa92efa /builtin/fsck.c | |
parent | ae0d0795d736467202d9bfd535942be81529f84e (diff) | |
parent | ba3a08ca0ec0d800d2fdbe73984927c1d8199082 (diff) | |
download | git-52b7ab31d08d3e29870f7085c64de936e109f05d.tar.gz |
Merge branch 'jt/fsck-code-cleanup'
Plug recently introduced leaks in fsck.
* jt/fsck-code-cleanup:
fsck: fix leak when traversing trees
Diffstat (limited to 'builtin/fsck.c')
-rw-r--r-- | builtin/fsck.c | 8 |
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) |