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:
committed by
Junio C Hamano
parent
3ac22f82ed
commit
2756ca4347
@ -92,8 +92,7 @@ struct object_entry *packlist_alloc(struct packing_data *pdata,
|
||||
|
||||
if (pdata->nr_objects >= pdata->nr_alloc) {
|
||||
pdata->nr_alloc = (pdata->nr_alloc + 1024) * 3 / 2;
|
||||
pdata->objects = xrealloc(pdata->objects,
|
||||
pdata->nr_alloc * sizeof(*new_entry));
|
||||
REALLOC_ARRAY(pdata->objects, pdata->nr_alloc);
|
||||
}
|
||||
|
||||
new_entry = pdata->objects + pdata->nr_objects++;
|
||||
|
||||
Reference in New Issue
Block a user