diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-12-23 18:32:18 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-12-23 18:32:18 +0100 |
commit | 77edd59394b3200b672c4cfd50e067ddb6193e2b (patch) | |
tree | 7ae766c84004c4d57b5494b53d80ae4fc1179769 /remote.c | |
parent | Merge branch 'js/range-diff-diff-merges' (diff) | |
parent | git: use calloc instead of malloc + memset where possible (diff) | |
download | git-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.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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); |