]> git.puffer.fish Git - matthieu/frr.git/commitdiff
bgpd: remove some useless initializations
authorJorge Boncompte [DTI2] <jorge@dti2.net>
Mon, 7 May 2012 16:52:57 +0000 (16:52 +0000)
committerDavid Lamparter <equinox@opensourcerouting.org>
Tue, 22 May 2012 18:25:49 +0000 (20:25 +0200)
* bgp_attr.c: (bgp_attr_default_intern) bgp_attr_default_set() already
  initializes the memory. Fixes a struct attr_extra leak.
* bgp_route.c: Remove useless on stack struct initializations.

Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
bgpd/bgp_attr.c
bgpd/bgp_route.c

index 8144cd36d3045e9e58ba949ac86447280be43c32..7c0f6cc6de090fe943c38054d0c24290844b8957 100644 (file)
@@ -559,10 +559,7 @@ bgp_attr_default_intern (u_char origin)
 {
   struct attr attr;
   struct attr *new;
-  
-  memset (&attr, 0, sizeof (struct attr));
-  bgp_attr_extra_get (&attr);
-  
+
   bgp_attr_default_set(&attr, origin);
 
   new = bgp_attr_intern (&attr);
index cb15c152ae386f6ac113e5fae0641b8b2ef460b6..68eae6a03b2a7292027923903235a2b67fb334a4 100644 (file)
@@ -2465,7 +2465,7 @@ void
 bgp_default_originate (struct peer *peer, afi_t afi, safi_t safi, int withdraw)
 {
   struct bgp *bgp;
-  struct attr attr = { 0 };
+  struct attr attr;
   struct aspath *aspath = { 0 };
   struct prefix p;
   struct bgp_info binfo;
@@ -3270,8 +3270,8 @@ bgp_static_update_rsclient (struct peer *rsclient, struct prefix *p,
   struct bgp_info *new;
   struct bgp_info info;
   struct attr *attr_new;
-  struct attr attr = {0 };
-  struct attr new_attr = { .extra = 0 };
+  struct attr attr;
+  struct attr new_attr = { 0 };
   struct bgp *bgp;
   int ret;
   char buf[SU_ADDRSTRLEN];
@@ -3423,7 +3423,7 @@ bgp_static_update_main (struct bgp *bgp, struct prefix *p,
   struct bgp_info *ri;
   struct bgp_info *new;
   struct bgp_info info;
-  struct attr attr = { 0 };
+  struct attr attr;
   struct attr *attr_new;
   int ret;
 
@@ -5352,7 +5352,7 @@ bgp_redistribute_add (struct prefix *p, const struct in_addr *nexthop,
   struct bgp_info *bi;
   struct bgp_info info;
   struct bgp_node *bn;
-  struct attr attr = { 0 };
+  struct attr attr;
   struct attr attr_new = { 0 };
   struct attr *new_attr;
   afi_t afi;