bgpd: Fix crash reported by NetDEF CI
This patch is part of the previously submitted
patch set on VPN and Encap SAFIs. It fixes
an issue identified by NetDEF CI.
Ensure temp stack structures are initialized
Add protection against double frees / post
free access to bgp_attr_flush
Signed-off-by: Lou Berger <lberger@labn.net>
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 2728b10..c364372 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -2121,6 +2121,9 @@
const char *reason;
char buf[SU_ADDRSTRLEN];
+ memset (&new_attr, 0, sizeof(struct attr));
+ memset (&new_extra, 0, sizeof(struct attr_extra));
+
bgp = peer->bgp;
rn = bgp_afi_node_get (bgp->rib[afi][safi], afi, safi, p, prd);