]> git.proxmox.com Git - mirror_frr.git/commitdiff
Merge pull request #12244 from anlancs/fix/bgpd-evpn-leak-l3rt
authorDonald Sharp <donaldsharp72@gmail.com>
Fri, 4 Nov 2022 15:59:32 +0000 (11:59 -0400)
committerGitHub <noreply@github.com>
Fri, 4 Nov 2022 15:59:32 +0000 (11:59 -0400)
bgpd: avoid possible memleak

1  2 
bgpd/bgp_evpn_vty.c

diff --combined bgpd/bgp_evpn_vty.c
index c74bd14b4e759d672afbeb66977ca25c344492ec,7dbfdc60d45a68f70efe99f5e49faafe265c2171..0f2ade8737d23a22b851703cd3d51e6241dc0c68
@@@ -3336,7 -3336,9 +3336,7 @@@ static void write_vni_config(struct vt
        }
  }
  
 -#ifndef VTYSH_EXTRACT_PL
  #include "bgpd/bgp_evpn_vty_clippy.c"
 -#endif
  
  DEFPY(bgp_evpn_flood_control,
        bgp_evpn_flood_control_cmd,
@@@ -6637,9 -6639,10 +6637,10 @@@ void bgp_config_write_evpn_info(struct 
                                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;