diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-02-15 23:55:41 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-02-15 23:55:41 +0100 |
commit | 52b7ab31d08d3e29870f7085c64de936e109f05d (patch) | |
tree | f5d33da660c35c36d8728a6ab700671bbaa92efa /builtin/fsck.c | |
parent | Merge branch 'en/merge-recursive-fixes' (diff) | |
parent | fsck: fix leak when traversing trees (diff) | |
download | git-52b7ab31d08d3e29870f7085c64de936e109f05d.tar.xz git-52b7ab31d08d3e29870f7085c64de936e109f05d.zip |
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) |