There are some situations where we create a ecommunity for
comparing to internal state when we are deleting, but in the
failure cases we would not free up the created memory.
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
if (rt_type == RT_TYPE_IMPORT) {
if (!bgp_evpn_rt_matches_existing(bgp->vrf_import_rtl,
ecomdel)) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VRF\n");
return CMD_WARNING;
} else if (rt_type == RT_TYPE_EXPORT) {
if (!bgp_evpn_rt_matches_existing(bgp->vrf_export_rtl,
ecomdel)) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VRF\n");
return CMD_WARNING;
}
if (!found_ecomdel) {
+ ecommunity_free(&ecomdel);
vty_out(vty,
"%% RT specified does not match configuration for this VRF\n");
return CMD_WARNING;
}
}
+ ecommunity_free(&ecomdel);
return CMD_SUCCESS;
}