Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
Merge branch 'jt/fsck-code-cleanup' into maint
author
Junio C Hamano
<gitster@pobox.com>
Thu, 22 Mar 2018 21:24:12 +0000
(14:24 -0700)
committer
Junio C Hamano
<gitster@pobox.com>
Thu, 22 Mar 2018 21:24:12 +0000
(14:24 -0700)
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:
34b9ec8
)
diff --git
a/builtin/fsck.c
b/builtin/fsck.c
index 04846d46f91d6cde14d379da8e0e3dd458c08dc5..92ce775a74d88036b024b24d74e3987da521ef41 100644
(file)
--- 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)