summaryrefslogtreecommitdiffstats
path: root/read-cache.c
diff options
context:
space:
mode:
authorDerrick Stolee <stolee@gmail.com>2024-10-01 19:37:44 +0200
committerJunio C Hamano <gitster@pobox.com>2024-10-01 20:51:15 +0200
commit5e6f359f6b7829e3baea888f5489f04eebf745af (patch)
tree214371998a6c14d19a4624a81f0839546d360728 /read-cache.c
parentGit 2.46 (diff)
downloadgit-5e6f359f6b7829e3baea888f5489f04eebf745af.tar.xz
git-5e6f359f6b7829e3baea888f5489f04eebf745af.zip
read-cache: free threaded memory pool
In load_cache_entries_threaded(), each thread allocates its own memory pool. This pool needs to be cleaned up while closing the threads down, or it will be leaked. This ce_mem_pool pointer could theoretically be converted to an inline copy of the struct, but the use of a pointer helps with existing lazy- initialization logic. Adjusting that behavior only to avoid this pointer would be a much bigger change. Signed-off-by: Derrick Stolee <stolee@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/read-cache.c b/read-cache.c
index 48bf24f87c..3b76a1f5d5 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -2187,6 +2187,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;
}