aboutsummaryrefslogtreecommitdiffstats
path: root/t/t0041-usage.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2023-07-10 17:12:13 -0400
committerJunio C Hamano <gitster@pobox.com>2023-07-10 14:48:55 -0700
commitb571fb98008b485bfc6f7d6538b79a7e92d731f4 (patch)
tree2837a8b21d55850720fab7e3a5dd42f53777e329 /t/t0041-usage.sh
parentref-filter: clear reachable list pointers after freeing (diff)
downloadgit-b571fb98008b485bfc6f7d6538b79a7e92d731f4.tar.gz
git-b571fb98008b485bfc6f7d6538b79a7e92d731f4.zip
ref-filter: add `ref_filter_clear()`
We did not bother to clean up at all in `git branch` or `git tag`, and `git for-each-ref` only cleans up a couple of members. Add and call `ref_filter_clear()` when cleaning up a `struct ref_filter`. Running this patch (without any test changes) indicates a couple of now leak-free tests. This was found by running: $ make SANITIZE=leak $ make -C t GIT_TEST_PASSING_SANITIZE_LEAK=check GIT_TEST_OPTS=--immediate (Note that the `reachable_from` and `unreachable_from` lists should be cleaned as they are used. So this is just covering any case where we might bail before running the reachability check.) Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0041-usage.sh')
-rwxr-xr-xt/t0041-usage.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t0041-usage.sh b/t/t0041-usage.sh
index c4fc34eb18..9ea974b0c6 100755
--- a/t/t0041-usage.sh
+++ b/t/t0041-usage.sh
@@ -5,6 +5,7 @@ test_description='Test commands behavior when given invalid argument value'
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup ' '