summaryrefslogtreecommitdiffstats
path: root/t/t6403-merge-file.sh
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2022-07-01 12:42:56 +0200
committerJunio C Hamano <gitster@pobox.com>2022-07-01 20:43:43 +0200
commite72e12cc02d80e4ebf01e0a3d170617211ae7c70 (patch)
treefd3159ad8ebe26def9f0a2d564b239024089a1f4 /t/t6403-merge-file.sh
parentmerge-file: refactor for subsequent memory leak fix (diff)
downloadgit-e72e12cc02d80e4ebf01e0a3d170617211ae7c70.tar.xz
git-e72e12cc02d80e4ebf01e0a3d170617211ae7c70.zip
merge-file: fix memory leaks on error path
Fix a memory leak in "merge-file", we need to loop over the "mmfs" array and free() what we've got so far when we error out. As a result we can mark a test as passing with SANITIZE=leak using "TEST_PASSES_SANITIZE_LEAK=true". Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6403-merge-file.sh')
-rwxr-xr-xt/t6403-merge-file.sh2
1 files changed, 2 insertions, 0 deletions
diff --git a/t/t6403-merge-file.sh b/t/t6403-merge-file.sh
index 2f421d967a..1a7082323d 100755
--- a/t/t6403-merge-file.sh
+++ b/t/t6403-merge-file.sh
@@ -1,6 +1,8 @@
#!/bin/sh
test_description='RCS merge replacement: merge-file'
+
+TEST_PASSES_SANITIZE_LEAK=true
. ./test-lib.sh
test_expect_success 'setup' '