mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-15 11:30:30 +00:00
bgpd: More ecommunity string leak cleanup
Do not leak the ecommunity string created. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
This commit is contained in:
parent
a2bce1c824
commit
c8f573499a
@ -457,16 +457,13 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
|
|||||||
struct bgp_node *bn;
|
struct bgp_node *bn;
|
||||||
const char *debugmsg;
|
const char *debugmsg;
|
||||||
|
|
||||||
if (debug) {
|
if (debug && info_vrf->attr->ecommunity) {
|
||||||
const char *s = "";
|
char *s = ecommunity_ecom2str(info_vrf->attr->ecommunity,
|
||||||
|
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||||
if (info_vrf->attr && info_vrf->attr->ecommunity) {
|
|
||||||
s = ecommunity_ecom2str(info_vrf->attr->ecommunity,
|
|
||||||
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
zlog_debug("%s: info_vrf->type=%d, EC{%s}", __func__,
|
zlog_debug("%s: info_vrf->type=%d, EC{%s}", __func__,
|
||||||
info_vrf->type, s);
|
info_vrf->type, s);
|
||||||
|
XFREE(MTYPE_ECOMMUNITY_STR, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!bgp_vpn)
|
if (!bgp_vpn)
|
||||||
@ -517,15 +514,13 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug && static_attr.ecommunity) {
|
||||||
const char *s = "";
|
char *s = ecommunity_ecom2str(static_attr.ecommunity,
|
||||||
|
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||||
|
|
||||||
if (static_attr.ecommunity) {
|
|
||||||
s = ecommunity_ecom2str(static_attr.ecommunity,
|
|
||||||
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
|
||||||
}
|
|
||||||
zlog_debug("%s: post route map static_attr.ecommunity{%s}",
|
zlog_debug("%s: post route map static_attr.ecommunity{%s}",
|
||||||
__func__, s);
|
__func__, s);
|
||||||
|
XFREE(MTYPE_ECOMMUNITY_STR, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -550,15 +545,13 @@ void vpn_leak_from_vrf_update(struct bgp *bgp_vpn, /* to */
|
|||||||
static_attr.ecommunity = new_ecom;
|
static_attr.ecommunity = new_ecom;
|
||||||
SET_FLAG(static_attr.flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
|
SET_FLAG(static_attr.flag, ATTR_FLAG_BIT(BGP_ATTR_EXT_COMMUNITIES));
|
||||||
|
|
||||||
if (debug) {
|
if (debug && static_attr.ecommunity) {
|
||||||
const char *s = "";
|
char *s = ecommunity_ecom2str(static_attr.ecommunity,
|
||||||
|
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
||||||
|
|
||||||
if (static_attr.ecommunity) {
|
|
||||||
s = ecommunity_ecom2str(static_attr.ecommunity,
|
|
||||||
ECOMMUNITY_FORMAT_ROUTE_MAP, 0);
|
|
||||||
}
|
|
||||||
zlog_debug("%s: post merge static_attr.ecommunity{%s}",
|
zlog_debug("%s: post merge static_attr.ecommunity{%s}",
|
||||||
__func__, s);
|
__func__, s);
|
||||||
|
XFREE(MTYPE_ECOMMUNITY_STR, s);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Nexthop */
|
/* Nexthop */
|
||||||
|
Loading…
Reference in New Issue
Block a user