diff options
author | hasso <hasso> | 2005-05-27 03:26:57 +0000 |
---|---|---|
committer | hasso <hasso> | 2005-05-27 03:26:57 +0000 |
commit | 70601e0691e178ca23f14fdc666a97efce26897f (patch) | |
tree | 02e822953d578b96c53a053b97573f6c009c6461 /bgpd/bgp_routemap.c | |
parent | 54a6ed38ac38777f5c2966f74a85cc12659efc87 (diff) |
* bgp_routemap.c: Stop leaking communities.
Fixes bugzilla #89. [backport candidate]
Diffstat (limited to 'bgpd/bgp_routemap.c')
-rw-r--r-- | bgpd/bgp_routemap.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c index fc2c8fd9..6c10987b 100644 --- a/bgpd/bgp_routemap.c +++ b/bgpd/bgp_routemap.c @@ -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; |