[PATCH 1/2] read-cache: free threaded memory pool
- From
Derrick Stolee via GitGitGadget <gitgitgadget@gmail.com>
- Date
- Sep 30, 2024, 11:40 UTC
- Message-ID
- <9a45b15ea4b9864cd3cff066ecd9281c4539d5f7.1727696424.git.gitgitgadget@gmail.com>
- In-Reply-To
- <pull.1801.git.1727696424.gitgitgadget@gmail.com>
From: Derrick Stolee <stolee@gmail.com>
In load_cache_entries_threaded(), each thread is allocated its own memory pool. This pool needs to be cleaned up while closing the threads down, or it will be leaked.
Signed-off-by: Derrick Stolee <stolee@gmail.com> --- read-cache.c | 1 + 1 file changed, 1 insertion(+)
diff --git a/read-cache.c b/read-cache.c index 764fdfec465..3c078afadbc 100644 --- a/read-cache.c +++ b/read-cache.c @@ -2188,6 +2188,7 @@ static unsigned long load_cache_entries_threaded(struct index_state *istate, con if (err) die(_("unable to join load_cache_entries thread: %s"), strerror(err)); mem_pool_combine(istate->ce_mem_pool, p->ce_mem_pool); + free(p->ce_mem_pool); consumed += p->consumed; }
-- gitgitgadget