]> git.proxmox.com Git - mirror_frr.git/commitdiff
* bgp_routemap.c: Stop leaking communities.
authorhasso <hasso>
Fri, 27 May 2005 03:26:57 +0000 (03:26 +0000)
committerhasso <hasso>
Fri, 27 May 2005 03:26:57 +0000 (03:26 +0000)
Fixes bugzilla #89. [backport candidate]

bgpd/ChangeLog
bgpd/bgp_routemap.c

index 7c339221fdfe98fd7c8b85148e70a195ea311a6f..2969c3261cd5e40fd700c8d4314c034c33340bd6 100644 (file)
@@ -1,3 +1,7 @@
+2005-05-27 Hasso Tepper <hasso at quagga.net>
+
+       * bgp_routemap.c: Stop leaking communities.
+
 2005-05-27 Hasso Tepper <hasso at quagga.net>
 
        * bgpd.c: Deleting bgp->rsclient list needs fix similar to pree-groups
index fc2c8fd96a35b81ab15bd3a99f7b7fd495b7b55a..6c10987bd19cf45c56c5a6c538100a15e84cc2f4 100644 (file)
@@ -1268,6 +1268,10 @@ route_set_community (void *rule, struct prefix *prefix,
        new = community_dup (rcs->com);
 
       attr->community = new;
+
+      if (old)
+       community_free (old);
+
       attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_COMMUNITIES);
     }
 
@@ -1448,6 +1452,9 @@ route_set_ecommunity_rt (void *rule, struct prefix *prefix,
 
       bgp_info->attr->ecommunity = new_ecom;
 
+      if (old_ecom)
+       ecommunity_free (old_ecom);
+
       bgp_info->attr->flag |= ATTR_FLAG_BIT (BGP_ATTR_EXT_COMMUNITIES);
     }
   return RMAP_OKAY;