Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2014-09-16 22:56:57 +0400
committerJunio C Hamano <gitster@pobox.com>2014-09-18 20:13:42 +0400
commit2756ca4347cbda05b16954cd7f445c216b935e76 (patch)
tree70afb2d44557fd05bbc0707c190c6026ab6135fd /shallow.c
parent3ac22f82edec108986b2627fcd6f2a8039617a23 (diff)
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 'shallow.c')
-rw-r--r--shallow.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/shallow.c b/shallow.c
index de07709e33..57f4afa6b4 100644
--- a/shallow.c
+++ b/shallow.c
@@ -392,8 +392,7 @@ static uint32_t *paint_alloc(struct paint_info *info)
void *p;
if (!info->slab_count || info->free + size > info->end) {
info->slab_count++;
- info->slab = xrealloc(info->slab,
- info->slab_count * sizeof(*info->slab));
+ REALLOC_ARRAY(info->slab, info->slab_count);
info->free = xmalloc(COMMIT_SLAB_SIZE);
info->slab[info->slab_count - 1] = info->free;
info->end = info->free + COMMIT_SLAB_SIZE;