diff options
| author | Patrick Steinhardt <ps@pks.im> | 2024-09-30 11:13:10 +0200 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2024-09-30 11:23:02 -0700 |
| commit | 9a48fc1da277f37b602f48e8bec22f4725ebf877 (patch) | |
| tree | 807f4459b7a7588952096beaff73adb573286997 /t/t8001-annotate.sh | |
| parent | a5031223cda0f37f70b901f7a2b7cd78e0627d82 (diff) | |
| download | git-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-x | t/t8001-annotate.sh | 1 |
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' |
