summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_flowspec.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2018-05-16 15:54:03 +0200
committerDonald Sharp <sharpd@cumulusnetworks.com>2018-05-16 15:59:06 +0200
commitc7ee6c35cb2c7149f6a3ab53cea4d7e212ebe0f6 (patch)
treef2ebef36552e7cf9a95b281c21bbacc37c7d5a15 /bgpd/bgp_flowspec.c
parentbgpd: remove unnecessary test and allocate a bit earlier (diff)
downloadfrr-c7ee6c35cb2c7149f6a3ab53cea4d7e212ebe0f6.tar.xz
frr-c7ee6c35cb2c7149f6a3ab53cea4d7e212ebe0f6.zip
bgpd: Fix memory leak of ecommunity_ecom2str
The creation of a temporary string for the ecommunity was being leaked when debugging is enabled. Write a bit of code to prevent this. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to '')
-rw-r--r--bgpd/bgp_flowspec.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/bgpd/bgp_flowspec.c b/bgpd/bgp_flowspec.c
index 5db7e3708..6eb1e3988 100644
--- a/bgpd/bgp_flowspec.c
+++ b/bgpd/bgp_flowspec.c
@@ -166,6 +166,9 @@ int bgp_nlri_parse_flowspec(struct peer *peer, struct attr *attr,
BGP_FLOWSPEC_NLRI_STRING_MAX,
"EC{%s}",
s == NULL ? "none" : s);
+
+ if (s)
+ ecommunity_strfree(&s);
}
snprintf(local_string, BGP_FLOWSPEC_NLRI_STRING_MAX,
"FS Rx %s %s %s %s", withdraw ?