summaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-08-08 09:36:00 +0200
committerJunio C Hamano <gitster@pobox.com>2024-08-08 18:22:21 +0200
commit6f1e9394e2e02d16dfbef02c1585a1acfd2a5118 (patch)
tree5d2d01e416eb67e41ffe56193260ae7ba803c619 /t
parentsubmodule: fix leaking seen submodule names (diff)
downloadgit-6f1e9394e2e02d16dfbef02c1585a1acfd2a5118.tar.xz
git-6f1e9394e2e02d16dfbef02c1585a1acfd2a5118.zip
object: fix leaking packfiles when closing object store
When calling `raw_object_store_clear()`, we close and free several resources associated with the object store. Part of that is to close and free all the packfiles, which is handled by `close_object_store()`. That function really only ends up closing the packfiles though, but it doesn't free them. And in fact it can't, as that function is being called via `run_command()` when `close_object_store = 1`, which is done e.g. when we execute git-maintenance(1). At that point, other structures may still have references on those packfiles, and thus we cannot free them here. So while it is in fact intentional that we really only close them, the result is a memory leak because `raw_object_store_clear()` does not free them, either. Fix the leak by freeing the packfiles in `raw_object_store_clear()`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7424-submodule-mixed-ref-formats.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t7424-submodule-mixed-ref-formats.sh b/t/t7424-submodule-mixed-ref-formats.sh
index 559713b607..b43ef2ba67 100755
--- a/t/t7424-submodule-mixed-ref-formats.sh
+++ b/t/t7424-submodule-mixed-ref-formats.sh
@@ -2,6 +2,7 @@
test_description='submodules handle mixed ref storage formats'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_ref_format () {