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

List:       quagga-dev
Subject:    [quagga-dev 251] PATCH: suspected "reference leak" in
From:       Gilad Arnold <gilad.arnold () terayon ! com>
Date:       2003-09-24 8:50:11
[Download RAW message or body]

Hi,

I believe that this fixes a "reference leak" (not really a memory leak, 
but rather an inaccurate management of route node reference counters 
that may cause excess memory consumption and possible inconsistencies -- 
counter wrap-around, etc). Patch is against today's CVS snapshot.

I'll appreciate some feedback on this.

Thanks,
Gilad


(PS: it holds for zebra code as well, patching is trivial)


["quagga.static-del-refleak.20030924.diff" (text/plain)]

Index: zebra/zebra_rib.c
===================================================================
RCS file: /var/cvsroot/quagga/zebra/zebra_rib.c,v
retrieving revision 1.11
diff -c -u -r1.11 zebra_rib.c
--- zebra/zebra_rib.c	15 Jul 2003 12:52:22 -0000	1.11
+++ zebra/zebra_rib.c	24 Sep 2003 08:43:30 -0000
@@ -1575,11 +1575,14 @@
     rn->info = si->next;
   if (si->next)
     si->next->prev = si->prev;
+  route_unlock_node (rn);
   
   /* Free static route configuration. */
   if (ifname)
     XFREE (0, si->gate.ifname);
   XFREE (MTYPE_STATIC_IPV4, si);
+
+  route_unlock_node (rn);
 
   return 1;
 }


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

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