summaryrefslogtreecommitdiff
path: root/pack-objects.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-16 20:56:57 +0200
committerJunio C Hamano <gitster@pobox.com>2014-09-18 09:13:42 -0700
commit2756ca4347cbda05b16954cd7f445c216b935e76 (patch)
tree70afb2d44557fd05bbc0707c190c6026ab6135fd /pack-objects.c
parent3ac22f82edec108986b2627fcd6f2a8039617a23 (diff)
downloadgit-2756ca4347cbda05b16954cd7f445c216b935e76.tar.gz
use REALLOC_ARRAY for changing the allocation size of arraysrs/realloc-array
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.c3
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++;