Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jt/fsck-code-cleanup'
author
Junio C Hamano
<gitster@pobox.com>
Thu, 15 Feb 2018 22:55:41 +0000
(14:55 -0800)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 15 Feb 2018 22:55:41 +0000
(14:55 -0800)
Plug recently introduced leaks in fsck.
* jt/fsck-code-cleanup:
fsck: fix leak when traversing trees
builtin/fsck.c
patch
|
blob
|
history
raw
(from parent 1:
ae0d079
)
diff --git
a/builtin/fsck.c
b/builtin/fsck.c
index 7a8a679d4f3d0cf6d95991927947cbd00359868c..9981db22637c027019c206583f24dc2b665deeff 100644
(file)
--- 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)