[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[or-cvs] Fix memory leak in routerlist_remove_old_routers().



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv16846/src/or

Modified Files:
	routerlist.c 
Log Message:
Fix memory leak in routerlist_remove_old_routers().

Index: routerlist.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/routerlist.c,v
retrieving revision 1.422
retrieving revision 1.423
diff -u -p -d -r1.422 -r1.423
--- routerlist.c	10 Jan 2006 22:42:44 -0000	1.422
+++ routerlist.c	11 Jan 2006 03:58:07 -0000	1.423
@@ -1802,7 +1802,7 @@ routerlist_remove_old_routers(void)
    */
   if (smartlist_len(routerlist->old_routers) <
       smartlist_len(routerlist->routers) * (MAX_DESCRIPTORS_PER_ROUTER - 1))
-    return;
+    goto done;
 
   smartlist_sort(routerlist->old_routers, _compare_old_routers_by_identity);
 
@@ -1823,6 +1823,8 @@ routerlist_remove_old_routers(void)
   if (hi>=0)
     routerlist_remove_old_cached_routers_with_id(cutoff, 0, hi, retain);
   routerlist_assert_ok(routerlist);
+
+ done:
   digestmap_free(retain, NULL);
 }