]> git.puffer.fish Git - matthieu/frr.git/commitdiff
[ospfd] Fix OSPF route refcount leak
authorStephen Hemminger <stephen.hemminger@vyatta.com>
Wed, 3 Jun 2009 23:44:21 +0000 (16:44 -0700)
committerPaul Jakma <paul@quagga.net>
Thu, 18 Jun 2009 19:18:26 +0000 (20:18 +0100)
This may fix vyatta BUG 3096. The reference count for OSPF route table was
never completely freed on deleting all neighbors.

ospfd/ospfd.c

index f2784887f8f0e81f0849cb197fd2bb9b6609093f..a9714f58d3fc456548ff112dd3a9f9224e03f017 100644 (file)
@@ -782,12 +782,13 @@ ospf_network_unset (struct ospf *ospf, struct prefix_ipv4 *p,
     return 0;
 
   network = rn->info;
+  route_unlock_node (rn);
   if (!IPV4_ADDR_SAME (&area_id, &network->area_id))
     return 0;
 
   ospf_network_free (ospf, rn->info);
   rn->info = NULL;
-  route_unlock_node (rn);
+  route_unlock_node (rn);      /* initial reference */
 
   /* Find interfaces that not configured already.  */
   for (ALL_LIST_ELEMENTS (ospf->oiflist, node, nnode, oi))