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 /builtin/index-pack.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 '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 5568a5bc3b..783623dbe2 100644
--- a/builtin/index-pack.c
+++ b/builtin/index-pack.c
@@ -1140,9 +1140,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);