builtin/difftool: plug several trivial memory leaks
There are several leaking data structures in git-difftool(1). Plug them. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
dea4a9521e
commit
7f795a1715
@ -660,6 +660,12 @@ finish:
|
|||||||
if (fp)
|
if (fp)
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
|
hashmap_clear_and_free(&working_tree_dups, struct working_tree_entry, entry);
|
||||||
|
hashmap_clear_and_free(&wt_modified, struct path_entry, entry);
|
||||||
|
hashmap_clear_and_free(&tmp_modified, struct path_entry, entry);
|
||||||
|
hashmap_clear_and_free(&submodules, struct pair_entry, entry);
|
||||||
|
hashmap_clear_and_free(&symlinks2, struct pair_entry, entry);
|
||||||
|
release_index(&wtindex);
|
||||||
free(lbase_dir);
|
free(lbase_dir);
|
||||||
free(rbase_dir);
|
free(rbase_dir);
|
||||||
strbuf_release(&info);
|
strbuf_release(&info);
|
||||||
|
@ -11,6 +11,7 @@ Testing basic diff tool invocation
|
|||||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||||
|
|
||||||
|
TEST_PASSES_SANITIZE_LEAK=true
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
difftool_test_setup ()
|
difftool_test_setup ()
|
||||||
|
Reference in New Issue
Block a user