Skip to content

Commit

Permalink
bgpd: fix memory leak in bgp_aggregate_install()
Browse files Browse the repository at this point in the history
Potential memory leak with as-set and matching-MED-only config.

Signed-off-by: Enke Chen <[email protected]>
  • Loading branch information
enkechen-panw committed Jan 8, 2025
1 parent 3d7dbcf commit 4f80a6b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion bgpd/bgp_route.c
Original file line number Diff line number Diff line change
Expand Up @@ -8000,8 +8000,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) {
/*
Expand Down

0 comments on commit 4f80a6b

Please sign in to comment.