/
uis
/
git
/
x
/
uis
/
git
/
git.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
(from parent 1:
ae0d079
)
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
|
blame
|
history
diff --git
a/builtin/fsck.c
b/builtin/fsck.c
index
7a8a679
..
9981db2
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)