mirror of
https://github.com/git/git.git
synced 2024-11-23 01:46:13 +08:00
revision: fix leaking bloom filters
The memory allocated by `prepare_to_use_bloom_filter()` is not released by `release_revisions()`, causing a memory leak. Plug it. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
43fedde3df
commit
e29ff075e0
@ -3227,6 +3227,11 @@ void release_revisions(struct rev_info *revs)
|
||||
clear_decoration(&revs->treesame, free);
|
||||
line_log_free(revs);
|
||||
oidset_clear(&revs->missing_commits);
|
||||
|
||||
for (int i = 0; i < revs->bloom_keys_nr; i++)
|
||||
clear_bloom_key(&revs->bloom_keys[i]);
|
||||
FREE_AND_NULL(revs->bloom_keys);
|
||||
revs->bloom_keys_nr = 0;
|
||||
}
|
||||
|
||||
static void add_child(struct rev_info *revs, struct commit *parent, struct commit *child)
|
||||
|
@ -4,6 +4,7 @@ test_description='git log for a path with Bloom filters'
|
||||
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-chunk.sh
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user