From 393deb9bd663361e6b110d579a8b1d4c22667068 Mon Sep 17 00:00:00 2001 From: Stephen Hemminger Date: Mon, 18 Aug 2008 14:13:29 -0700 Subject: [cleanup] Convert XMALLOC/memset to XCALLOC Simple conversion of XMALLOC/memset to XCALLOC --- lib/linklist.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'lib/linklist.c') diff --git a/lib/linklist.c b/lib/linklist.c index a16e9e18..485a80be 100644 --- a/lib/linklist.c +++ b/lib/linklist.c @@ -28,11 +28,7 @@ struct list * list_new (void) { - struct list *new; - - new = XMALLOC (MTYPE_LINK_LIST, sizeof (struct list)); - memset (new, 0, sizeof (struct list)); - return new; + return XCALLOC (MTYPE_LINK_LIST, sizeof (struct list)); } /* Free list. */ @@ -46,11 +42,7 @@ list_free (struct list *l) static struct listnode * listnode_new (void) { - struct listnode *node; - - node = XMALLOC (MTYPE_LINK_NODE, sizeof (struct listnode)); - memset (node, 0, sizeof (struct listnode)); - return node; + return XCALLOC (MTYPE_LINK_NODE, sizeof (struct listnode)); } /* Free listnode. */ -- cgit v1.2.1