summaryrefslogtreecommitdiffstats
path: root/bgpd/bgp_vty.c
diff options
context:
space:
mode:
authorDonatas Abraitis <donatas@opensourcerouting.org>2024-12-20 15:15:15 +0100
committerGitHub <noreply@github.com>2024-12-20 15:15:15 +0100
commit7f4374fefc342c29f450a2214e8e9a2ba706a59b (patch)
treed602fd89fc1f723dbd9c936190b9dae864ca847b /bgpd/bgp_vty.c
parentMerge pull request #17673 from Jafaral/pim-coverity (diff)
parentbgpd: fix memory leak when reconfiguring a route distinguisher (diff)
downloadfrr-7f4374fefc342c29f450a2214e8e9a2ba706a59b.tar.xz
frr-7f4374fefc342c29f450a2214e8e9a2ba706a59b.zip
Merge pull request #17669 from pguibert6WIND/rdvpn_mem_leak
bgpd: fix memory leak when reconfiguring a route distinguisher
Diffstat (limited to 'bgpd/bgp_vty.c')
-rw-r--r--bgpd/bgp_vty.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/bgpd/bgp_vty.c b/bgpd/bgp_vty.c
index 39aae35ae..311051ae4 100644
--- a/bgpd/bgp_vty.c
+++ b/bgpd/bgp_vty.c
@@ -9806,6 +9806,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;