bgpd: Fix memory leak in bgpd/bgp_route.c
In function bgp_aggregate_add, variables 'aspath' and 'community'
are malloced but not guaranteed to be freed before the function
returns.
Signed-off-by: Denil Vira <denil@cumulusnetworks.com>
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 7de9461..4db2e3e 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -4888,6 +4888,13 @@
/* Process change. */
bgp_process (bgp, rn, afi, safi);
}
+ else
+ {
+ if (aspath)
+ aspath_free (aspath);
+ if (community)
+ community_free (community);
+ }
}
void