aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2024-06-11 11:21:29 +0200
committerJunio C Hamano <gitster@pobox.com>2024-06-11 13:15:08 -0700
commitfbf7a46d881429ef5495af7bbf3a6c3dacbf80b3 (patch)
tree0762caddb96d527a56611eb19741536a8e0cee00 /t
parent3332f35577ccbb51a50d88d16caafcceaab23767 (diff)
downloadgit-fbf7a46d881429ef5495af7bbf3a6c3dacbf80b3.tar.xz
builtin/blame: fix leaking ignore revs files
When parsing the blame configuration we add "blame.ignoreRevsFile" configs to a string list. This string list is declared as with `NODUP`, and thus we hand over the allocated string to that list. We eventually end up calling `string_list_clear()` on that list, but due to it being declared as `NODUP` we will not release the associated strings and thus leak memory. Fix this issue by setting up the list as `DUP` instead and free the config string after insertion. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t8013-blame-ignore-revs.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t8013-blame-ignore-revs.sh b/t/t8013-blame-ignore-revs.sh
index dbfbd86e83..d33788d867 100755
--- a/t/t8013-blame-ignore-revs.sh
+++ b/t/t8013-blame-ignore-revs.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='ignore revisions when blaming'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
# Creates: