diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-03-22 14:24:12 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-22 14:24:12 -0700 |
commit | d78b7eb2d50bd1cf57d7f06c1b4bdd8e08057926 (patch) | |
tree | de93ab1fc46b8aadba6ca8b60d41b5cecf2b1e1e | |
parent | 34b9ec8dd9bf6d3f6fa04f295351f917042a33fa (diff) | |
parent | ba3a08ca0ec0d800d2fdbe73984927c1d8199082 (diff) | |
download | git-d78b7eb2d50bd1cf57d7f06c1b4bdd8e08057926.tar.gz |
Merge branch 'jt/fsck-code-cleanup' into maint
Plug recently introduced leaks in fsck.
* jt/fsck-code-cleanup:
fsck: fix leak when traversing trees
-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 04846d46f9..92ce775a74 100644 --- a/builtin/fsck.c +++ b/builtin/fsck.c @@ -171,7 +171,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) |