Skip to content

Commit

Permalink
Merge pull request #14906 from Keelan10/bgp_confederation-leak
Browse files Browse the repository at this point in the history
bgpd: Free Memory for confed_peers in bgp_free
  • Loading branch information
donaldsharp authored Nov 29, 2023
2 parents 8a72aff + 60d80cb commit 4aff978
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions bgpd/bgpd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4aff978

Please sign in to comment.