aboutsummaryrefslogtreecommitdiffstats
path: root/t/t8008-blame-formats.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/t8008-blame-formats.sh
parentee6a998583108cebc0db28d70df2aa1b547b6251 (diff)
downloadgit-3332f35577ccbb51a50d88d16caafcceaab23767.tar.gz
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/t8008-blame-formats.sh')
-rwxr-xr-xt/t8008-blame-formats.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t8008-blame-formats.sh b/t/t8008-blame-formats.sh
index ae4b579d24..fb5d225a67 100755
--- a/t/t8008-blame-formats.sh
+++ b/t/t8008-blame-formats.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='blame output in various formats on a simple case'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '