Merge pull request #17811 from enkechen-panw/aggr-fix3

bgpd: fix memory leak in bgp_aggregate_install()
This commit is contained in:
Donatas Abraitis 2025-01-10 09:47:21 +02:00 committed by GitHub
commit 35c0c827f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -7962,8 +7962,15 @@ static void bgp_aggregate_install(
* If we have paths with different MEDs, then don't install * If we have paths with different MEDs, then don't install
* (or uninstall) the aggregate route. * (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; goto uninstall_aggregate_route;
}
if (aggregate->count > 0) { if (aggregate->count > 0) {
/* /*