aboutsummaryrefslogtreecommitdiffstats
path: root/t/t7010-setup.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-11 11:21:25 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-11 13:15:08 -0700
commit3332f35577ccbb51a50d88d16caafcceaab23767 (patch)
treefc04475a6d497eebc65cfb9a78b7a625892875be /t/t7010-setup.sh
parentblame: fix leaking data for blame scoreboards (diff)
downloadgit-3332f35577ccbb51a50d88d16caafcceaab23767.tar.gz
git-3332f35577ccbb51a50d88d16caafcceaab23767.zip
builtin/blame: fix leaking prefixed paths
In `cmd_blame()` we compute prefixed paths by calling `add_prefix()`, which itself calls `prefix_path()`. While `prefix_path()` returns an allocated string, `add_prefix()` pretends to return a constant string. Consequently, this path never gets freed. Fix the return type to be `char *` and free the path to plug the memory leak. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7010-setup.sh')
-rwxr-xr-xt/t7010-setup.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t7010-setup.sh b/t/t7010-setup.sh
index 520f96d09f..d9add2162e 100755
--- a/t/t7010-setup.sh
+++ b/t/t7010-setup.sh
@@ -2,6 +2,7 @@
test_description='setup taking and sanitizing funny paths'
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success setup '