revisions API: have release_revisions() release "filter"

Extend the the release_revisions() function so that it frees the "filter" in the "struct rev_info". This in combination with a preceding change to free "cmdline" means that we can mark another set of tests as passing under "TEST_PASSES_SANITIZE_LEAK=true". The "filter" member was added recently in ffaa137f646 (revision: put object filter into struct rev_info, 2022-03-09), and this fixes leaks intruded in the subsequent leak 7940941de1f (pack-objects: use rev.filter when possible, 2022-03-09) and 105c6f14ad3 (bundle: parse filter capability, 2022-03-09). The "builtin/pack-objects.c" leak in 7940941de1f was effectively with us already, but the variable was referred to by a "static" file-scoped variable. The "bundle.c " leak in 105c6f14ad3 was newly introduced with the new "filter" feature for bundles. The "t5600-clone-fail-cleanup.sh" change here to add "TEST_PASSES_SANITIZE_LEAK=true" is one of the cases where run-command.c in not carrying the abort() exit code upwards would have had that test passing before, but now it *actually* passes[1]. We should fix the lack of 1=1 mapping of SANITIZE=leak testing to actual leaks some other time, but it's an existing edge case, let's just mark the really-passing test as passing for now. 1. https://lore.kernel.org/git/220303.86fsnz5o9w.gmgdl@evledraar.gmail.com/ Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ævar Arnfjörð Bjarmason committed Apr 13, 2022 at 22:01 UTC e75d2f7f73420884c50613a8242812b55ad2a8fa
18 files changed +25 -1
revision.c
+1
@@ -2948,6 +2948,7 @@ void release_revisions(struct rev_info *revs)
2948 free_commit_list(revs->commits);
2949 object_array_clear(&revs->pending);
2950 release_revisions_cmdline(&revs->cmdline);
2951 + list_objects_filter_release(&revs->filter);
2952 release_revisions_mailmap(revs->mailmap);
2953 }
2954
t/t1060-object-corruption.sh
+1
@@ -2,6 +2,7 @@
2
3 test_description='see how we handle various forms of corruption'
4
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 # convert "1234abcd" to ".git/objects/12/34abcd"
t/t2015-checkout-unborn.sh
+1
@@ -4,6 +4,7 @@ test_description='checkout from unborn branch'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 +TEST_PASSES_SANITIZE_LEAK=true
8 . ./test-lib.sh
9
10 test_expect_success 'setup' '
t/t4207-log-decoration-colors.sh
+1
@@ -8,6 +8,7 @@ test_description='Test for "git log --decorate" colors'
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 +TEST_PASSES_SANITIZE_LEAK=true
12 . ./test-lib.sh
13
14 test_expect_success setup '
t/t5301-sliding-window.sh
+2
@@ -4,6 +4,8 @@
4 #
5
6 test_description='mmap sliding window tests'
7 +
8 +TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10
11 test_expect_success \
t/t5313-pack-bounds-checks.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='bounds-checking of access to mmapped on-disk file formats'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 clear_base () {
t/t5316-pack-delta-depth.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='pack-objects breaks long cross-pack delta chains'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 # This mirrors a repeated push setup:
t/t5320-delta-islands.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='exercise delta islands'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 # returns true iff $1 is a delta based on $2
t/t5322-pack-objects-sparse.sh
+1
@@ -4,6 +4,7 @@ test_description='pack-objects object selection using sparse algorithm'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 +TEST_PASSES_SANITIZE_LEAK=true
8 . ./test-lib.sh
9
10 test_expect_success 'setup repo' '
t/t5506-remote-groups.sh
+1
@@ -4,6 +4,7 @@ test_description='git remote group handling'
4 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
5 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
6
7 +TEST_PASSES_SANITIZE_LEAK=true
8 . ./test-lib.sh
9
10 mark() {
t/t5513-fetch-track.sh
+1
@@ -2,6 +2,7 @@
2
3 test_description='fetch follows remote-tracking branches correctly'
4
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_expect_success setup '
t/t5532-fetch-proxy.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='fetching via git:// using core.gitproxy'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_expect_success 'setup remote repo' '
t/t5600-clone-fail-cleanup.sh
+1
@@ -13,6 +13,7 @@ Unless the directory already exists, in which case we clean up only what we
13 wrote.
14 '
15
16 +TEST_PASSES_SANITIZE_LEAK=true
17 . ./test-lib.sh
18
19 corrupt_repo () {
t/t5900-repo-selection.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='selecting remote repo in ambiguous cases'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 reset() {
t/t6101-rev-parse-parents.sh
+1
@@ -8,6 +8,7 @@ test_description='Test git rev-parse with different parent options'
8 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
9 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
10
11 +TEST_PASSES_SANITIZE_LEAK=true
12 . ./test-lib.sh
13
14 test_cmp_rev_output () {
t/t6114-keep-packs.sh
+2
@@ -1,6 +1,8 @@
1 #!/bin/sh
2
3 test_description='rev-list with .keep packs'
4 +
5 +TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
7
8 test_expect_success 'setup' '
t/t7702-repack-cyclic-alternate.sh
+2
@@ -4,6 +4,8 @@
4 #
5
6 test_description='repack involving cyclic alternate'
7 +
8 +TEST_PASSES_SANITIZE_LEAK=true
9 . ./test-lib.sh
10
11 test_expect_success setup '
t/t9127-git-svn-partial-rebuild.sh
-1
@@ -5,7 +5,6 @@
5
6 test_description='git svn partial-rebuild tests'
7
8 -TEST_FAILS_SANITIZE_LEAK=true
8 . ./lib-git-svn.sh
9
10 test_expect_success 'initialize svnrepo' '