about summary refs log tree commit diff
path: root/third_party/git/split-index.c
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/split-index.c')
-rw-r--r--third_party/git/split-index.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/third_party/git/split-index.c b/third_party/git/split-index.c
index e6154e4ea955..c0e8ad670d0a 100644
--- a/third_party/git/split-index.c
+++ b/third_party/git/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);
 	}