diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-18 14:13:29 -0700 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-12 17:07:49 +0100 |
commit | 393deb9bd663361e6b110d579a8b1d4c22667068 (patch) | |
tree | e93ebf2f57bf92ff7a9cd045764b3cdbb99a07e5 /bgpd/bgp_nexthop.c | |
parent | 3453a7122c1d585ad789ed0f63deb90cc5e89fae (diff) |
[cleanup] Convert XMALLOC/memset to XCALLOC
Simple conversion of XMALLOC/memset to XCALLOC
Diffstat (limited to 'bgpd/bgp_nexthop.c')
-rw-r--r-- | bgpd/bgp_nexthop.c | 18 |
1 files changed, 5 insertions, 13 deletions
diff --git a/bgpd/bgp_nexthop.c b/bgpd/bgp_nexthop.c index 22e48db0..b2ee7f3b 100644 --- a/bgpd/bgp_nexthop.c +++ b/bgpd/bgp_nexthop.c @@ -98,11 +98,7 @@ bnc_nexthop_free (struct bgp_nexthop_cache *bnc) static struct bgp_nexthop_cache * bnc_new () { - struct bgp_nexthop_cache *new; - - new = XMALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache)); - memset (new, 0, sizeof (struct bgp_nexthop_cache)); - return new; + return XCALLOC (MTYPE_BGP_NEXTHOP_CACHE, sizeof (struct bgp_nexthop_cache)); } static void @@ -575,8 +571,7 @@ bgp_connected_add (struct connected *ifc) } else { - bc = XMALLOC (0, sizeof (struct bgp_connected_ref)); - memset (bc, 0, sizeof (struct bgp_connected_ref)); + bc = XCALLOC (0, sizeof (struct bgp_connected_ref)); bc->refcnt = 1; rn->info = bc; } @@ -601,8 +596,7 @@ bgp_connected_add (struct connected *ifc) } else { - bc = XMALLOC (0, sizeof (struct bgp_connected_ref)); - memset (bc, 0, sizeof (struct bgp_connected_ref)); + bc = XCALLOC (0, sizeof (struct bgp_connected_ref)); bc->refcnt = 1; rn->info = bc; } @@ -748,8 +742,7 @@ zlookup_read () for (i = 0; i < nexthop_num; i++) { - nexthop = XMALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); - memset (nexthop, 0, sizeof (struct nexthop)); + nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); nexthop->type = stream_getc (s); switch (nexthop->type) { @@ -858,8 +851,7 @@ zlookup_read_ipv6 () for (i = 0; i < nexthop_num; i++) { - nexthop = XMALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); - memset (nexthop, 0, sizeof (struct nexthop)); + nexthop = XCALLOC (MTYPE_NEXTHOP, sizeof (struct nexthop)); nexthop->type = stream_getc (s); switch (nexthop->type) { |