Merge pull request #13918 from rameshabhinay/evpn_memleak

bgpd: fix bgp evpn cli memory leaks.
This commit is contained in:
Jafar Al-Gharaibeh 2023-07-18 10:59:20 -05:00 committed by GitHub
commit 975b8e5e9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -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;
}

View File

@ -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,