diff options
author | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-18 14:13:29 -0700 |
---|---|---|
committer | Stephen Hemminger <stephen.hemminger@vyatta.com> | 2008-08-18 14:13:29 -0700 |
commit | aa990a9f58b5f46da95eb360049577a8833d649e (patch) | |
tree | faeff19a39b9c1df101fe381920e52178011e99a /bgpd/bgp_route.c | |
parent | e5d63369e1f3fdc1c22ae15fe477de1f97022703 (diff) | |
download | quagga-aa990a9f58b5f46da95eb360049577a8833d649e.tar.bz2 quagga-aa990a9f58b5f46da95eb360049577a8833d649e.tar.xz |
Use XCALLOC
Replace calls to XMALLOC followed by memset with XCALLOC.
Diffstat (limited to 'bgpd/bgp_route.c')
-rw-r--r-- | bgpd/bgp_route.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c index e8b3b70d..db8e36d5 100644 --- a/bgpd/bgp_route.c +++ b/bgpd/bgp_route.c @@ -129,12 +129,7 @@ bgp_info_extra_get (struct bgp_info *ri) static struct bgp_info * bgp_info_new () { - struct bgp_info *new; - - new = XMALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info)); - memset (new, 0, sizeof (struct bgp_info)); - - return new; + return XCALLOC (MTYPE_BGP_ROUTE, sizeof (struct bgp_info)); } /* Free bgp route information. */ @@ -3088,10 +3083,7 @@ bgp_nlri_sanity_check (struct peer *peer, int afi, u_char *pnt, static struct bgp_static * bgp_static_new () { - struct bgp_static *new; - new = XMALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static)); - memset (new, 0, sizeof (struct bgp_static)); - return new; + return XCALLOC (MTYPE_BGP_STATIC, sizeof (struct bgp_static)); } static void @@ -4476,10 +4468,7 @@ struct bgp_aggregate static struct bgp_aggregate * bgp_aggregate_new () { - struct bgp_aggregate *new; - new = XMALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate)); - memset (new, 0, sizeof (struct bgp_aggregate)); - return new; + return XCALLOC (MTYPE_BGP_AGGREGATE, sizeof (struct bgp_aggregate)); } static void @@ -10826,10 +10815,7 @@ struct bgp_distance static struct bgp_distance * bgp_distance_new () { - struct bgp_distance *new; - new = XMALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance)); - memset (new, 0, sizeof (struct bgp_distance)); - return new; + return XCALLOC (MTYPE_BGP_DISTANCE, sizeof (struct bgp_distance)); } static void |