summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-19 22:25:37 (GMT)
commiteabacfd9cb58f22ffbacf935bf03747a08640fc7 (patch)
tree90aaab851e4b8340e4e53945d4734c9232c46c29 /builtin
parenta5828ae6b52137b913b978e16cd2334482eb4c1f (diff)
parent486f4bd183b2b9e3355c7d0d47462951c659613d (diff)
downloadgit-eabacfd9cb58f22ffbacf935bf03747a08640fc7.zip
git-eabacfd9cb58f22ffbacf935bf03747a08640fc7.tar.gz
git-eabacfd9cb58f22ffbacf935bf03747a08640fc7.tar.bz2
Merge branch 'jc/calloc-fix'
Code clean-up. * jc/calloc-fix: xcalloc: use CALLOC_ARRAY() when applicable
Diffstat (limited to 'builtin')
-rw-r--r--builtin/receive-pack.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/builtin/receive-pack.c b/builtin/receive-pack.c
index d26040c..1724726 100644
--- a/builtin/receive-pack.c
+++ b/builtin/receive-pack.c
@@ -2313,11 +2313,9 @@ static void prepare_shallow_update(struct shallow_info *si)
ALLOC_ARRAY(si->used_shallow, si->shallow->nr);
assign_shallow_commits_to_refs(si, si->used_shallow, NULL);
- si->need_reachability_test =
- xcalloc(si->shallow->nr, sizeof(*si->need_reachability_test));
- si->reachable =
- xcalloc(si->shallow->nr, sizeof(*si->reachable));
- si->shallow_ref = xcalloc(si->ref->nr, sizeof(*si->shallow_ref));
+ CALLOC_ARRAY(si->need_reachability_test, si->shallow->nr);
+ CALLOC_ARRAY(si->reachable, si->shallow->nr);
+ CALLOC_ARRAY(si->shallow_ref, si->ref->nr);
for (i = 0; i < si->nr_ours; i++)
si->need_reachability_test[si->ours[i]] = 1;