aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorRoger Dingledine <arma@torproject.org>2007-06-07 15:07:33 +0000
committerRoger Dingledine <arma@torproject.org>2007-06-07 15:07:33 +0000
commit8db1b61a267d9d55796f41e6114eb6fe27b05e24 (patch)
treed235fe6485ed41acac70770a4b84f392d6c9dcda /src
parenta0fb2137b182a366f8f164d138e7c741bc43cb27 (diff)
downloadtor-8db1b61a267d9d55796f41e6114eb6fe27b05e24.tar
tor-8db1b61a267d9d55796f41e6114eb6fe27b05e24.tar.gz
avoid leaking memory in a path never followed. pointed out
by robert watson. svn:r10521
Diffstat (limited to 'src')
-rw-r--r--src/or/circuitbuild.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c
index 21be66dd1..896c0903e 100644
--- a/src/or/circuitbuild.c
+++ b/src/or/circuitbuild.c
@@ -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,