aboutsummaryrefslogtreecommitdiffstats
path: root/split-index.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-08-27 14:04:48 -0700
committerJunio C Hamano <gitster@pobox.com>2020-08-27 14:04:48 -0700
commitedab8a8d07eff5771ad08e7d2935f5df992c2c45 (patch)
tree3f1719a2ace7c9accb3fc883f7167dcfce2844b8 /split-index.c
parentTenth batch (diff)
parentmem-pool: use consistent pool variable name (diff)
downloadgit-edab8a8d07eff5771ad08e7d2935f5df992c2c45.tar.gz
git-edab8a8d07eff5771ad08e7d2935f5df992c2c45.zip
Merge branch 'en/mem-pool'
API update. * en/mem-pool: mem-pool: use consistent pool variable name mem-pool: use more standard initialization and finalization mem-pool: add convenience functions for strdup and strndup
Diffstat (limited to 'split-index.c')
-rw-r--r--split-index.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/split-index.c b/split-index.c
index e6154e4ea9..c0e8ad670d 100644
--- a/split-index.c
+++ b/split-index.c
@@ -79,8 +79,10 @@ void move_cache_to_base_index(struct index_state *istate)
if (si->base &&
si->base->ce_mem_pool) {
- if (!istate->ce_mem_pool)
- mem_pool_init(&istate->ce_mem_pool, 0);
+ if (!istate->ce_mem_pool) {
+ istate->ce_mem_pool = xmalloc(sizeof(struct mem_pool));
+ mem_pool_init(istate->ce_mem_pool, 0);
+ }
mem_pool_combine(istate->ce_mem_pool, istate->split_index->base->ce_mem_pool);
}