diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2022-07-01 12:42:56 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-07-01 20:43:43 +0200 |
commit | e72e12cc02d80e4ebf01e0a3d170617211ae7c70 (patch) | |
tree | fd3159ad8ebe26def9f0a2d564b239024089a1f4 /t/t6403-merge-file.sh | |
parent | merge-file: refactor for subsequent memory leak fix (diff) | |
download | git-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-x | t/t6403-merge-file.sh | 2 |
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' ' |