mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-04 18:25:00 +00:00
bgpd: avoid possible memleak
In the case of without ':' in `ecom_str`, memleak on this `ecom_str` will occur. Just free `ecom_str` for this case. Signed-off-by: anlan_cs <vic.lan@pica8.com>
This commit is contained in:
parent
a5dac02901
commit
ed8862ad30
@ -6639,9 +6639,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;
|
||||
|
Loading…
Reference in New Issue
Block a user