summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bgpd/bgp_route.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/bgpd/bgp_route.c b/bgpd/bgp_route.c
index 93d27aa167..a87cd21f22 100644
--- a/bgpd/bgp_route.c
+++ b/bgpd/bgp_route.c
@@ -7753,8 +7753,13 @@ static void bgp_aggregate_install(
* If we have paths with different MEDs, then don't install
* (or uninstall) the aggregate route.
*/
- if (aggregate->match_med && aggregate->med_mismatched)
+ if (aggregate->match_med && aggregate->med_mismatched) {
+ aspath_free(aspath);
+ community_free(&community);
+ ecommunity_free(&ecommunity);
+ lcommunity_free(&lcommunity);
goto uninstall_aggregate_route;
+ }
if (aggregate->count > 0) {
/*