diff options
author | Donald Sharp <donaldsharp72@gmail.com> | 2022-11-04 16:59:32 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-04 16:59:32 +0100 |
commit | 3e85fb337332c8dbdf0a8834515170556f530b94 (patch) | |
tree | d052f5e8b87c15bec6c0ae1021bb396255e474b4 /bgpd/bgp_evpn_vty.c | |
parent | Merge pull request #12252 from opensourcerouting/fix/frr-reload.py_reuse_non_... (diff) | |
parent | bgpd: avoid possible memleak (diff) | |
download | frr-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.c | 7 |
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; |