aboutsummaryrefslogtreecommitdiff
path: root/builtin/index-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-09-26 14:39:45 -0700
committerJunio C Hamano <gitster@pobox.com>2014-09-26 14:39:45 -0700
commit1c2ea2cdc0e8c4e5af942c51b234c5af527944f6 (patch)
tree26554b52f6dcd97e2194c4b0c32106b6a2b72f92 /builtin/index-pack.c
parentb33000878a88b52816b97aeb88ba3677902ad277 (diff)
parent2756ca4347cbda05b16954cd7f445c216b935e76 (diff)
downloadgit-1c2ea2cdc0e8c4e5af942c51b234c5af527944f6.tar.gz
git-1c2ea2cdc0e8c4e5af942c51b234c5af527944f6.tar.xz
Merge branch 'rs/realloc-array'
Code cleanup. * rs/realloc-array: use REALLOC_ARRAY for changing the allocation size of arrays add macro REALLOC_ARRAY
Diffstat (limited to 'builtin/index-pack.c')
-rw-r--r--builtin/index-pack.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/builtin/index-pack.c b/builtin/index-pack.c
index f89df017c..792c66ca5 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1170,9 +1170,7 @@ static void conclude_pack(int fix_thin_pack, const char *curr_pack, unsigned cha
int nr_objects_initial = nr_objects;
if (nr_unresolved <= 0)
die(_("confusion beyond insanity"));
- objects = xrealloc(objects,
- (nr_objects + nr_unresolved + 1)
- * sizeof(*objects));
+ REALLOC_ARRAY(objects, nr_objects + nr_unresolved + 1);
memset(objects + nr_objects + 1, 0,
nr_unresolved * sizeof(*objects));
f = sha1fd(output_fd, curr_pack);