mirror of
https://github.com/git/git
synced 2024-11-04 16:17:49 +00:00
submodule: fix leaking memory for submodule entries
In `free_one_config()` we never end up freeing the `url` and `ignore` fields and thus leak memory. Fix those leaks and mark now-passing tests as leak free. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
ba9d029445
commit
3ef52dd112
5 changed files with 6 additions and 0 deletions
|
@ -91,6 +91,8 @@ static void free_one_config(struct submodule_entry *entry)
|
|||
free((void *) entry->config->path);
|
||||
free((void *) entry->config->name);
|
||||
free((void *) entry->config->branch);
|
||||
free((void *) entry->config->url);
|
||||
free((void *) entry->config->ignore);
|
||||
free((void *) entry->config->update_strategy.command);
|
||||
free(entry->config);
|
||||
}
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='read-tree can handle submodules'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-submodule-update.sh
|
||||
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='checkout can handle submodules'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-submodule-update.sh
|
||||
|
||||
|
|
|
@ -6,6 +6,7 @@ This test verifies the recurse-submodules feature correctly lists files from
|
|||
submodules.
|
||||
'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
test_expect_success 'setup directory structure and submodules' '
|
||||
|
|
|
@ -2,6 +2,7 @@
|
|||
|
||||
test_description='reset can handle submodules'
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
. "$TEST_DIRECTORY"/lib-submodule-update.sh
|
||||
|
||||
|
|
Loading…
Reference in a new issue