use REALLOC_ARRAY for changing the allocation size of arrays

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
René Scharfe
2014-09-16 20:56:57 +02:00
committed by Junio C Hamano
parent 3ac22f82ed
commit 2756ca4347
26 changed files with 40 additions and 70 deletions

View File

@ -400,10 +400,8 @@ static int ext_index_add_object(struct object *object, const char *name)
if (hash_ret > 0) {
if (eindex->count >= eindex->alloc) {
eindex->alloc = (eindex->alloc + 16) * 3 / 2;
eindex->objects = xrealloc(eindex->objects,
eindex->alloc * sizeof(struct object *));
eindex->hashes = xrealloc(eindex->hashes,
eindex->alloc * sizeof(uint32_t));
REALLOC_ARRAY(eindex->objects, eindex->alloc);
REALLOC_ARRAY(eindex->hashes, eindex->alloc);
}
bitmap_pos = eindex->count;