[or-cvs] r10521: avoid leaking memory in a path never followed. pointed out b (tor/trunk/src/or)

arma at seul.org arma at seul.org
Thu Jun 7 15:07:34 UTC 2007


Author: arma
Date: 2007-06-07 11:07:33 -0400 (Thu, 07 Jun 2007)
New Revision: 10521

Modified:
   tor/trunk/src/or/circuitbuild.c
Log:
avoid leaking memory in a path never followed. pointed out
by robert watson.


Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2007-06-07 08:49:20 UTC (rev 10520)
+++ tor/trunk/src/or/circuitbuild.c	2007-06-07 15:07:33 UTC (rev 10521)
@@ -2274,10 +2274,8 @@
 entry_guards_prepend_from_config(void)
 {
   or_options_t *options = get_options();
-  smartlist_t *entry_routers = smartlist_create();
-  smartlist_t *old_entry_guards_on_list = smartlist_create();
-  smartlist_t *old_entry_guards_not_on_list = smartlist_create();
-  smartlist_t *entry_fps = smartlist_create();
+  smartlist_t *entry_routers, *entry_fps;
+  smartlist_t *old_entry_guards_on_list, *old_entry_guards_not_on_list;
   tor_assert(entry_guards);
 
   should_add_entry_nodes = 0;
@@ -2293,6 +2291,11 @@
   log_info(LD_CIRC,"Adding configured EntryNodes '%s'.",
            options->EntryNodes);
 
+  entry_routers = smartlist_create();
+  entry_fps = smartlist_create();
+  old_entry_guards_on_list = smartlist_create();
+  old_entry_guards_not_on_list = smartlist_create();
+
   /* Split entry guards into those on the list and those not. */
   add_nickname_list_to_smartlist(entry_routers, options->EntryNodes, 0);
   SMARTLIST_FOREACH(entry_routers, routerinfo_t *, ri,



More information about the tor-commits mailing list