aboutsummaryrefslogtreecommitdiffstats
path: root/t/t8001-annotate.sh
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-09-30 11:13:10 +0200
committerJunio C Hamano <gitster@pobox.com>2024-09-30 11:23:02 -0700
commit9a48fc1da277f37b602f48e8bec22f4725ebf877 (patch)
tree807f4459b7a7588952096beaff73adb573286997 /t/t8001-annotate.sh
parenta5031223cda0f37f70b901f7a2b7cd78e0627d82 (diff)
downloadgit-9a48fc1da277f37b602f48e8bec22f4725ebf877.tar.gz
builtin/annotate: fix leaking args vector
We're leaking the args vector in git-annotate(1) because we never clear it. Fixing it isn't as easy as calling `strvec_clear()` though because calling `cmd_blame()` will cause the underlying array to be modified. Instead, we also need to pass a shallow copy of the argv array to the function. Do so to plug the memory leaks. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t8001-annotate.sh')
-rwxr-xr-xt/t8001-annotate.sh1
1 files changed, 1 insertions, 0 deletions
diff --git a/t/t8001-annotate.sh b/t/t8001-annotate.sh
index d7167f5539..d434698919 100755
--- a/t/t8001-annotate.sh
+++ b/t/t8001-annotate.sh
@@ -5,6 +5,7 @@ GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
TEST_CREATE_REPO_NO_TEMPLATE=1
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
PROG='git annotate'