[sheepdog] [PATCH] use xcalloc for xzalloc implementation

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Mon Oct 22 05:58:38 CEST 2012


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 lib/util.c |    5 +----
 1 files changed, 1 insertions(+), 4 deletions(-)

diff --git a/lib/util.c b/lib/util.c
index 9ef27ff..3b3870d 100644
--- a/lib/util.c
+++ b/lib/util.c
@@ -55,10 +55,7 @@ void *xmalloc(size_t size)
 
 void *xzalloc(size_t size)
 {
-	void *ret;
-	ret = xmalloc(size);
-	memset(ret, 0, size);
-	return ret;
+	return xcalloc(1, size);
 }
 
 notrace void *xrealloc(void *ptr, size_t size)
-- 
1.7.2.5




More information about the sheepdog mailing list