Skip to content

Commit

Permalink
Merge pull request #17811 from enkechen-panw/aggr-fix3
Browse files Browse the repository at this point in the history
bgpd: fix memory leak in bgp_aggregate_install()
  • Loading branch information
ton31337 authored Jan 10, 2025
2 parents 485342f + 36ce18d commit 35c0c82
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -7962,8 +7962,15 @@ 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);
if (debug)
zlog_debug(" aggregate %pFX: med mismatch", p);
goto uninstall_aggregate_route;
}

if (aggregate->count > 0) {
/*
Expand Down

0 comments on commit 35c0c82

Please sign in to comment.