Merge pull request #14906 from Keelan10/bgp_confederation-leak

bgpd: Free Memory for confed_peers in bgp_free
This commit is contained in:
Donald Sharp 2023-11-29 13:49:37 -05:00 committed by GitHub
commit 4aff978cee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -4060,10 +4060,14 @@ void bgp_free(struct bgp *bgp)
bgp_srv6_cleanup(bgp);
bgp_confederation_id_unset(bgp);
for (int i = 0; i < bgp->confed_peers_cnt; i++)
XFREE(MTYPE_BGP_NAME, bgp->confed_peers[i].as_pretty);
XFREE(MTYPE_BGP_NAME, bgp->as_pretty);
XFREE(MTYPE_BGP_NAME, bgp->name);
XFREE(MTYPE_BGP_NAME, bgp->name_pretty);
XFREE(MTYPE_BGP_NAME, bgp->snmp_stats);
XFREE(MTYPE_BGP_CONFED_LIST, bgp->confed_peers);
XFREE(MTYPE_BGP, bgp);
}