aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorBrandon Casey <casey@nrlssc.navy.mil>2008-10-06 18:39:10 -0500
committerShawn O. Pearce <spearce@spearce.org>2008-10-08 07:30:59 -0700
commit19d4b416f429ac2d3f4c225aaf1af8761bcb03dd (patch)
tree6675797b5e141a32cf8c4d551be3dddc5e5fc020 /remote.c
parent276328ffb87cefdc515bee5f09916aea6e0244ed (diff)
downloadgit-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.tar.gz
git-19d4b416f429ac2d3f4c225aaf1af8761bcb03dd.tar.xz
Replace xmalloc/memset(0) pairs with xcalloc
Many call sites immediately initialize allocated memory with zero after calling xmalloc. A single call to xcalloc can replace this two-call sequence. Signed-off-by: Brandon Casey <casey@nrlssc.navy.mil> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/remote.c b/remote.c
index c45d96e98..a2d7ab146 100644
--- a/remote.c
+++ b/remote.c
@@ -751,8 +751,7 @@ int remote_find_tracking(struct remote *remote, struct refspec *refspec)
struct ref *alloc_ref(unsigned namelen)
{
- struct ref *ret = xmalloc(sizeof(struct ref) + namelen);
- memset(ret, 0, sizeof(struct ref) + namelen);
+ struct ref *ret = xcalloc(1, sizeof(struct ref) + namelen);
return ret;
}