diff options
author | Jafar Al-Gharaibeh <jafar@atcorp.com> | 2023-07-18 17:59:20 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-18 17:59:20 +0200 |
commit | 975b8e5e9c68e2f237cf96cf3beeaa81dfb22197 (patch) | |
tree | 12576275062da7a1a461ba8e71174caa135018cb | |
parent | Merge pull request #11831 from anlancs/fix/cleanup-default (diff) | |
parent | bgpd: fix bgp evpn cli memory leaks. (diff) | |
download | frr-975b8e5e9c68e2f237cf96cf3beeaa81dfb22197.tar.xz frr-975b8e5e9c68e2f237cf96cf3beeaa81dfb22197.zip |
Merge pull request #13918 from rameshabhinay/evpn_memleak
bgpd: fix bgp evpn cli memory leaks.
-rw-r--r-- | bgpd/bgp_evpn_vty.c | 8 | ||||
-rw-r--r-- | bgpd/bgp_vty.c | 2 |
2 files changed, 10 insertions, 0 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c index 77a997d17..442dd6ff3 100644 --- a/bgpd/bgp_evpn_vty.c +++ b/bgpd/bgp_evpn_vty.c @@ -6973,6 +6973,8 @@ DEFUN(bgp_evpn_ead_es_rt, bgp_evpn_ead_es_rt_cmd, if (!bgp_evpn_rt_matches_existing(bgp_mh_info->ead_es_export_rtl, ecomadd)) bgp_evpn_mh_config_ead_export_rt(bgp, ecomadd, false); + else + ecommunity_free(&ecomadd); return CMD_SUCCESS; } @@ -7010,6 +7012,7 @@ DEFUN(no_bgp_evpn_ead_es_rt, no_bgp_evpn_ead_es_rt_cmd, } bgp_evpn_mh_config_ead_export_rt(bgp, ecomdel, true); + ecommunity_free(&ecomdel); return CMD_SUCCESS; } @@ -7061,6 +7064,8 @@ DEFUN (bgp_evpn_vni_rt, /* Do nothing if we already have this import route-target */ if (!bgp_evpn_rt_matches_existing(vpn->import_rtl, ecomadd)) evpn_configure_import_rt(bgp, vpn, ecomadd); + else + ecommunity_free(&ecomadd); } /* Add/update the export route-target */ @@ -7077,6 +7082,8 @@ DEFUN (bgp_evpn_vni_rt, /* Do nothing if we already have this export route-target */ if (!bgp_evpn_rt_matches_existing(vpn->export_rtl, ecomadd)) evpn_configure_export_rt(bgp, vpn, ecomadd); + else + ecommunity_free(&ecomadd); } return CMD_SUCCESS; @@ -7184,6 +7191,7 @@ DEFUN (no_bgp_evpn_vni_rt, } } + ecommunity_free(&ecomdel); return CMD_SUCCESS; } diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 49ee767ba..02ee5320e 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -8612,6 +8612,8 @@ DEFPY (neighbor_soo, ecommunity_free(&peer->soo[afi][safi]); peer->soo[afi][safi] = ecomm_soo; peer_af_flag_unset(peer, afi, safi, PEER_FLAG_SOO); + } else { + ecommunity_free(&ecomm_soo); } return bgp_vty_return(vty, |