[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quagga-dev
Subject:    [quagga-dev 8171] [PATCH] bgpd: fix memory leak when deleting a
From:       Michael Lambert <lambert () psc ! edu>
Date:       2010-08-23 16:54:37
Message-ID: 20100823174035.954CEA56292 () ebola ! psc ! edu
[Download RAW message or body]

* bgp_routemap.c: (route_set_community_delete) When deleting a
  community in a route-map the old community was being orphaned.
---
 bgpd/bgp_routemap.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/bgpd/bgp_routemap.c b/bgpd/bgp_routemap.c
index aa7dbce..b8da186 100644
--- a/bgpd/bgp_routemap.c
+++ b/bgpd/bgp_routemap.c
@@ -1484,6 +1484,7 @@ route_set_community_delete (void *rule, struct prefix *prefix,
 	  merge = community_list_match_delete (community_dup (old), list);
 	  new = community_uniq_sort (merge);
 	  community_free (merge);
+	  if (old->refcnt == 0) community_free (old);
 
 	  if (new->size == 0)
 	    {
-- 
1.7.1.1

_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://lists.quagga.net/mailman/listinfo/quagga-dev
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic