mirror of
https://github.com/git/git.git
synced 2024-11-23 09:56:28 +08:00
builtin/name-rev: fix various trivial memory leaks
There are several structures that we don't release after `cmd_name_rev()` is done. 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
ed041007f0
commit
ac3b143370
@ -677,7 +677,9 @@ int cmd_name_rev(int argc, const char **argv, const char *prefix)
|
||||
always, allow_undefined, data.name_only);
|
||||
}
|
||||
|
||||
UNLEAK(string_pool);
|
||||
UNLEAK(revs);
|
||||
string_list_clear(&data.ref_filters, 0);
|
||||
string_list_clear(&data.exclude_filters, 0);
|
||||
mem_pool_discard(&string_pool, 0);
|
||||
object_array_clear(&revs);
|
||||
return 0;
|
||||
}
|
||||
|
@ -5,6 +5,7 @@ test_description='test git rev-list --cherry-pick -- file'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
# A---B---D---F
|
||||
|
@ -14,6 +14,7 @@ test_description='test describe'
|
||||
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
||||
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
||||
|
||||
TEST_PASSES_SANITIZE_LEAK=true
|
||||
. ./test-lib.sh
|
||||
|
||||
check_describe () {
|
||||
|
Loading…
Reference in New Issue
Block a user