From dea4a9521ea134bbc12bce492b1ae467f5ff1bd1 Mon Sep 17 00:00:00 2001 From: Patrick Steinhardt Date: Thu, 26 Sep 2024 13:46:40 +0200 Subject: builtin/repack: fix leaking configuration When repacking, we assemble git-pack-objects(1) arguments both for the "normal" pack and for the cruft pack. This configuration gets populated with a bunch of `OPT_PASSTHRU` options that we end up passing to the child process. These options are allocated, but never free'd. Create a new `pack_objects_args_release()` function that releases the memory for us and call it for both sets of options. Signed-off-by: Patrick Steinhardt Signed-off-by: Junio C Hamano --- t/t5329-pack-objects-cruft.sh | 2 ++ t/t7700-repack.sh | 1 + 2 files changed, 3 insertions(+) (limited to 't') diff --git a/t/t5329-pack-objects-cruft.sh b/t/t5329-pack-objects-cruft.sh index fc5fedbe9b..445739d06c 100755 --- a/t/t5329-pack-objects-cruft.sh +++ b/t/t5329-pack-objects-cruft.sh @@ -1,6 +1,8 @@ #!/bin/sh test_description='cruft pack related pack-objects tests' + +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh objdir=.git/objects diff --git a/t/t7700-repack.sh b/t/t7700-repack.sh index be1188e736..c4c3d1a15d 100755 --- a/t/t7700-repack.sh +++ b/t/t7700-repack.sh @@ -2,6 +2,7 @@ test_description='git repack works correctly' +TEST_PASSES_SANITIZE_LEAK=true . ./test-lib.sh . "${TEST_DIRECTORY}/lib-bitmap.sh" . "${TEST_DIRECTORY}/lib-midx.sh" -- cgit v1.3-6-g1900