From 2756ca4347cbda05b16954cd7f445c216b935e76 Mon Sep 17 00:00:00 2001 From: René Scharfe Date: Tue, 16 Sep 2014 20:56:57 +0200 Subject: use REALLOC_ARRAY for changing the allocation size of arrays Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- pack-bitmap.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'pack-bitmap.c') diff --git a/pack-bitmap.c b/pack-bitmap.c index 91e410153..a1f3c0d34 100644 --- a/pack-bitmap.c +++ b/pack-bitmap.c @@ -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; -- cgit v1.2.3