]> git.ipfire.org Git - thirdparty/tor.git/commitdiff
avoid leaking memory in a path never followed. pointed out
authorRoger Dingledine <arma@torproject.org>
Thu, 7 Jun 2007 15:07:33 +0000 (15:07 +0000)
committerRoger Dingledine <arma@torproject.org>
Thu, 7 Jun 2007 15:07:33 +0000 (15:07 +0000)
by robert watson.

svn:r10521

src/or/circuitbuild.c

index 21be66dd13e4d1227ede3246d5187d2035658558..896c0903e77d3b23e80ddc5333eee759bdde75f3 100644 (file)
@@ -2274,10 +2274,8 @@ static void
 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 @@ entry_guards_prepend_from_config(void)
   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,