free rt_entry when deleting route
authorMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Wed, 10 Aug 2011 17:20:42 +0000 (17:20 +0000)
committerMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Wed, 10 Aug 2011 17:20:42 +0000 (17:20 +0000)
src/process_routes.c

index 4f3ce84..37c403d 100644 (file)
@@ -331,7 +331,11 @@ olsr_update_rib_routes(void)
 
       /* oops, all routes are gone - flush the route head */
   
-      if (olsr_delete_kernel_route(rt) == 0) avl_delete(&routingtree, &rt->rt_tree_node); /*only remove if deletion was successful*/
+      if (olsr_delete_kernel_route(rt) == 0) {
+        /*only remove if deletion was successful*/
+        avl_delete(&routingtree, &rt->rt_tree_node);
+        olsr_cookie_free(rt_mem_cookie, rt);
+      }
 
       continue;
     }