summaryrefslogtreecommitdiffstats
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2024-12-23 18:32:18 +0100
committerJunio C Hamano <gitster@pobox.com>2024-12-23 18:32:18 +0100
commit77edd59394b3200b672c4cfd50e067ddb6193e2b (patch)
tree7ae766c84004c4d57b5494b53d80ae4fc1179769 /remote.c
parentMerge branch 'js/range-diff-diff-merges' (diff)
parentgit: use calloc instead of malloc + memset where possible (diff)
downloadgit-77edd59394b3200b672c4cfd50e067ddb6193e2b.tar.xz
git-77edd59394b3200b672c4cfd50e067ddb6193e2b.zip
Merge branch 'sk/calloc-not-malloc-plus-memset'
Code clean-up. * sk/calloc-not-malloc-plus-memset: git: use calloc instead of malloc + memset where possible
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index b80e810a90..18e5ccf391 100644
--- a/remote.c
+++ b/remote.c
@@ -2873,9 +2873,9 @@ void apply_push_cas(struct push_cas_option *cas,
struct remote_state *remote_state_new(void)
{
- struct remote_state *r = xmalloc(sizeof(*r));
+ struct remote_state *r;
- memset(r, 0, sizeof(*r));
+ CALLOC_ARRAY(r, 1);
hashmap_init(&r->remotes_hash, remotes_hash_cmp, NULL, 0);
hashmap_init(&r->branches_hash, branches_hash_cmp, NULL, 0);