From 19d4b416f429ac2d3f4c225aaf1af8761bcb03dd Mon Sep 17 00:00:00 2001 From: Brandon Casey Date: Mon, 6 Oct 2008 18:39:10 -0500 Subject: 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 Signed-off-by: Shawn O. Pearce --- remote.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'remote.c') 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; } -- cgit v1.2.1