diff options
author | René Scharfe <l.s.r@web.de> | 2014-09-16 20:56:57 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-09-18 18:13:42 +0200 |
commit | 2756ca4347cbda05b16954cd7f445c216b935e76 (patch) | |
tree | 70afb2d44557fd05bbc0707c190c6026ab6135fd /pack-objects.c | |
parent | add macro REALLOC_ARRAY (diff) | |
download | git-2756ca4347cbda05b16954cd7f445c216b935e76.tar.xz git-2756ca4347cbda05b16954cd7f445c216b935e76.zip |
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>
Diffstat (limited to 'pack-objects.c')
-rw-r--r-- | pack-objects.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/pack-objects.c b/pack-objects.c index 9992f3ecf2..6398a8aa96 100644 --- a/pack-objects.c +++ b/pack-objects.c @@ -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++; |