summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-01 10:37:22 -0800
committerStephen Hemminger <stephen.hemminger@vyatta.com>2008-12-01 10:37:22 -0800
commitcfbb47cacca2764e1562c2db856e848de8fb0e63 (patch)
tree1b1fcab2692c17ed0d37eeeebdbc117363f123af
parentdf80bcb4ed31a29e379949f0e8612ce709d0c6df (diff)
downloadquagga-cfbb47cacca2764e1562c2db856e848de8fb0e63.tar.bz2
quagga-cfbb47cacca2764e1562c2db856e848de8fb0e63.tar.xz
Use XCALLOC instead of XMALLOC/memset
A couple more trivial optimization.
-rw-r--r--bgpd/bgp_attr.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/bgpd/bgp_attr.c b/bgpd/bgp_attr.c
index d116c30f..cda4a32d 100644
--- a/bgpd/bgp_attr.c
+++ b/bgpd/bgp_attr.c
@@ -153,8 +153,7 @@ cluster_dup (struct cluster_list *cluster)
{
struct cluster_list *new;
- new = XMALLOC (MTYPE_CLUSTER, sizeof (struct cluster_list));
- memset (new, 0, sizeof (struct cluster_list));
+ new = XCALLOC (MTYPE_CLUSTER, sizeof (struct cluster_list));
new->length = cluster->length;
if (cluster->length)
@@ -1495,10 +1494,7 @@ bgp_attr_unknown (struct peer *peer, struct attr *attr, u_char flag,
/* Store transitive attribute to the end of attr->transit. */
if (! ((attre = bgp_attr_extra_get(attr))->transit) )
- {
- attre->transit = XMALLOC (MTYPE_TRANSIT, sizeof (struct transit));
- memset (attre->transit, 0, sizeof (struct transit));
- }
+ attre->transit = XCALLOC (MTYPE_TRANSIT, sizeof (struct transit));
transit = attre->transit;