bgpd: fix struct attr_extra leak in bgp_default_originate()
The call to bgp_attr_default_set() above creates the attr_extra struct,
but the attr.extra = NULL initialization was leaking it.
Signed-off-by: Jorge Boncompte [DTI2] <jorge@dti2.net>
Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 68eae6a..a421fd7 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2488,12 +2488,8 @@
#ifdef HAVE_IPV6
else if (afi == AFI_IP6)
{
- struct attr_extra *ae;
- attr.extra = NULL;
-
- ae = bgp_attr_extra_get (&attr);
- attr.extra = ae;
-
+ struct attr_extra *ae = attr.extra;
+
str2prefix ("::/0", &p);
/* IPv6 global nexthop must be included. */