summaryrefslogtreecommitdiffstats
path: root/t/t7416-submodule-dash-url.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2023-02-07 00:07:54 +0100
committerJunio C Hamano <gitster@pobox.com>2023-02-07 00:34:40 +0100
commitc65d18cb5259079f44c055c07bf46c13c75780c1 (patch)
tree6d777b1acb9305083e241b8613932a0d05015ae3 /t/t7416-submodule-dash-url.sh
parentpush: refactor refspec_append_mapped() for subsequent leak-fix (diff)
downloadgit-c65d18cb5259079f44c055c07bf46c13c75780c1.tar.xz
git-c65d18cb5259079f44c055c07bf46c13c75780c1.zip
push: free_refs() the "local_refs" in set_refspecs()
Fix a memory leak that's been with us since this code was added in ca02465b413 (push: use remote.$name.push as a refmap, 2013-12-03). The "remote = remote_get(...)" added in the same commit would seem to leak based only on the context here, but that function is a wrapper for sticking the remotes we fetch into "the_repository->remote_state". See fd3cb0501e1 (remote: move static variables into per-repository struct, 2021-11-17) for the addition of code in repository.c that free's the "remote" allocated here. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7416-submodule-dash-url.sh')
-rwxr-xr-xt/t7416-submodule-dash-url.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t7416-submodule-dash-url.sh b/t/t7416-submodule-dash-url.sh
index 3ebd985981..7cf72b9a07 100755
--- a/t/t7416-submodule-dash-url.sh
+++ b/t/t7416-submodule-dash-url.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='check handling of disallowed .gitmodule urls'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '