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 --- ripd/ripd.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'ripd/ripd.c') diff --git a/ripd/ripd.c b/ripd/ripd.c index 2525679c..cb2603d0 100644 --- a/ripd/ripd.c +++ b/ripd/ripd.c @@ -110,13 +110,9 @@ rip_route_rte (struct rip_info *rinfo) } static struct rip_info * -rip_info_new () +rip_info_new (void) { - struct rip_info *new; - - new = XMALLOC (MTYPE_RIP_INFO, sizeof (struct rip_info)); - memset (new, 0, sizeof (struct rip_info)); - return new; + return XCALLOC (MTYPE_RIP_INFO, sizeof (struct rip_info)); } void @@ -2697,8 +2693,7 @@ rip_redistribute_withdraw (int type) static int rip_create (void) { - rip = XMALLOC (MTYPE_RIP, sizeof (struct rip)); - memset (rip, 0, sizeof (struct rip)); + rip = XCALLOC (MTYPE_RIP, sizeof (struct rip)); /* Set initial value. */ rip->version_send = RI_RIP_VERSION_2; @@ -3117,10 +3112,7 @@ struct rip_distance static struct rip_distance * rip_distance_new (void) { - struct rip_distance *new; - new = XMALLOC (MTYPE_RIP_DISTANCE, sizeof (struct rip_distance)); - memset (new, 0, sizeof (struct rip_distance)); - return new; + return XCALLOC (MTYPE_RIP_DISTANCE, sizeof (struct rip_distance)); } static void -- cgit v1.2.1