Commit 999f5660 authored by Dmitry S. Dolzhenko's avatar Dmitry S. Dolzhenko Committed by Junio C Hamano

read-cache.c: use ALLOC_GROW() in add_index_entry()

Signed-off-by: default avatarDmitry S. Dolzhenko <[email protected]>
Signed-off-by: default avatarJunio C Hamano <[email protected]>
parent 66d9f38b
......@@ -993,11 +993,7 @@ int add_index_entry(struct index_state *istate, struct cache_entry *ce, int opti
/* Make sure the array is big enough .. */
if (istate->cache_nr == istate->cache_alloc) {
istate->cache_alloc = alloc_nr(istate->cache_alloc);
istate->cache = xrealloc(istate->cache,
istate->cache_alloc * sizeof(*istate->cache));
ALLOC_GROW(istate->cache, istate->cache_nr + 1, istate->cache_alloc);
/* Add it in.. */
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment