Merge pull request #12912 from opensourcerouting/fix/free_memory_on_shutdown

bgpd: Free aggregate route memory on shutdown
This commit is contained in:
Donald Sharp 2023-02-28 07:51:06 -05:00 committed by GitHub
commit 57fb014717
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7638,9 +7638,11 @@ void bgp_aggregate_route(struct bgp *bgp, const struct prefix *p, afi_t afi,
/* If the bgp instance is being deleted or self peer is deleted
* then do not create aggregate route
*/
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS)
|| (bgp->peer_self == NULL))
if (CHECK_FLAG(bgp->flags, BGP_FLAG_DELETE_IN_PROGRESS) ||
(bgp->peer_self == NULL)) {
bgp_aggregate_free(aggregate);
return;
}
/* Initialize and test routes for MED difference. */
if (aggregate->match_med)