summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_evpn_vty.c
diff options
context:
space:
mode:
authorDonald Sharp <donaldsharp72@gmail.com>2022-11-04 16:59:32 +0100
committerGitHub <noreply@github.com>2022-11-04 16:59:32 +0100
commit3e85fb337332c8dbdf0a8834515170556f530b94 (patch)
treed052f5e8b87c15bec6c0ae1021bb396255e474b4 /bgpd/bgp_evpn_vty.c
parentMerge pull request #12252 from opensourcerouting/fix/frr-reload.py_reuse_non_... (diff)
parentbgpd: avoid possible memleak (diff)
downloadfrr-3e85fb337332c8dbdf0a8834515170556f530b94.tar.xz
frr-3e85fb337332c8dbdf0a8834515170556f530b94.zip
Merge pull request #12244 from anlancs/fix/bgpd-evpn-leak-l3rt
bgpd: avoid possible memleak
Diffstat (limited to 'bgpd/bgp_evpn_vty.c')
-rw-r--r--bgpd/bgp_evpn_vty.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bgpd/bgp_evpn_vty.c b/bgpd/bgp_evpn_vty.c
index c74bd14b4..0f2ade873 100644
--- a/bgpd/bgp_evpn_vty.c
+++ b/bgpd/bgp_evpn_vty.c
@@ -6637,9 +6637,10 @@ void bgp_config_write_evpn_info(struct vty *vty, struct bgp *bgp, afi_t afi,
char *vni_str = NULL;
vni_str = strchr(ecom_str, ':');
-
- if (!vni_str)
- continue; /* This should never happen */
+ if (!vni_str) {
+ XFREE(MTYPE_ECOMMUNITY_STR, ecom_str);
+ continue;
+ }
/* Move pointer to vni */
vni_str += 1;