diff options
| author | Philippe Guibert <philippe.guibert@6wind.com> | 2024-12-18 16:53:48 +0100 | 
|---|---|---|
| committer | Mergify <37929162+mergify[bot]@users.noreply.github.com> | 2024-12-20 14:16:07 +0000 | 
| commit | d78b28822e4ea01f17eae875ae3d7cd4bbb2a8cf (patch) | |
| tree | ea0da55e2c2b787f79f3bc3b691ae3622531ef66 /bgpd/bgp_vty.c | |
| parent | d4db7054704b3fd8276611894677ed34ae021157 (diff) | |
bgpd: fix memory leak when reconfiguring a route distinguisher
A memory leak happens when reconfiguring an already configured route
distinguisher on an L3VPN BGP instance. Fix this by freeing the previous
route distinguisher.
Signed-off-by: Philippe Guibert <philippe.guibert@6wind.com>
(cherry picked from commit 0dd96287dda22b79ef6d7424f4e1a8dc92959f92)
Diffstat (limited to 'bgpd/bgp_vty.c')
| -rw-r--r-- | bgpd/bgp_vty.c | 2 | 
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c index 2ae63d37ac..8e29e90c7d 100644 --- a/bgpd/bgp_vty.c +++ b/bgpd/bgp_vty.c @@ -9708,6 +9708,8 @@ DEFPY (af_rd_vpn_export,  			   bgp_get_default(), bgp);  	if (yes) { +		if (bgp->vpn_policy[afi].tovpn_rd_pretty) +			XFREE(MTYPE_BGP_NAME, bgp->vpn_policy[afi].tovpn_rd_pretty);  		bgp->vpn_policy[afi].tovpn_rd_pretty = XSTRDUP(MTYPE_BGP_NAME,  							       rd_str);  		bgp->vpn_policy[afi].tovpn_rd = prd;  | 
