mirror of
https://github.com/git/git
synced 2024-11-05 01:58:18 +00:00
merge-recursive: fix memory leak when finalizing merge
We do not free some members of `struct merge_options`' private data. Fix this to plug those leaks. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
3199b22e7d
commit
8ff6bd4750
4 changed files with 7 additions and 0 deletions
|
@ -3800,6 +3800,9 @@ static void merge_finalize(struct merge_options *opt)
|
|||
if (show(opt, 2))
|
||||
diff_warn_rename_limit("merge.renamelimit",
|
||||
opt->priv->needed_rename_limit, 0);
|
||||
hashmap_clear_and_free(&opt->priv->current_file_dir_set,
|
||||
struct path_hashmap_entry, e);
|
||||
string_list_clear(&opt->priv->df_conflict_file_set, 0);
|
||||
FREE_AND_NULL(opt->priv);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ test_description='read-tree -m -u checks working tree files'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-read-tree.sh
|
||||
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
#!/bin/sh
|
||||
|
||||
test_description='Test various callers of read_index_unmerged'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup modify/delete + directory/file conflict' '
|
||||
|
|
|
@ -4,6 +4,7 @@ test_description='Test cherry-pick with directory/file conflicts'
|
|||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'Initialize repository' '
|
||||
|
|
Loading…
Reference in a new issue