mirror of
https://github.com/git-for-windows/git.git
synced 2026-06-17 16:45:52 -05:00
repository: free main reference database
While we release worktree and submodule reference databases when clearing a repository, we don't ever release the main reference database. This memory leak went unnoticed because its pointer is kept alive by the "chdir_notify" subsystem. Fix the memory leak. 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
8ee157ffc6
commit
3f6819c895
@@ -421,6 +421,11 @@ void repo_clear(struct repository *repo)
|
||||
FREE_AND_NULL(repo->remote_state);
|
||||
}
|
||||
|
||||
if (repo->refs_private) {
|
||||
ref_store_release(repo->refs_private);
|
||||
FREE_AND_NULL(repo->refs_private);
|
||||
}
|
||||
|
||||
strmap_for_each_entry(&repo->submodule_ref_stores, &iter, e)
|
||||
ref_store_release(e->value);
|
||||
strmap_clear(&repo->submodule_ref_stores, 1);
|
||||
|
||||
Reference in New Issue
Block a user