diff options
author | Roger Dingledine <arma@torproject.org> | 2007-05-24 23:38:14 +0000 |
---|---|---|
committer | Roger Dingledine <arma@torproject.org> | 2007-05-24 23:38:14 +0000 |
commit | f93226e3dcb664746b18dae830debbe2da81f5a4 (patch) | |
tree | d06de682525d9f1dd79f32e18daebd82fecc0b74 | |
parent | 6243cb2b7163d62d055eaa94340d250d03243c2d (diff) | |
download | tor-f93226e3dcb664746b18dae830debbe2da81f5a4.tar.gz tor-f93226e3dcb664746b18dae830debbe2da81f5a4.zip |
don't segfault when we're trying to build a testing circ to ourselves
svn:r10318
-rw-r--r-- | src/or/circuitbuild.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/or/circuitbuild.c b/src/or/circuitbuild.c index 054c8dfde7..6ef3677c28 100644 --- a/src/or/circuitbuild.c +++ b/src/or/circuitbuild.c @@ -2328,8 +2328,10 @@ choose_random_entry(cpath_build_state_t *state) int need_uptime = state->need_uptime; int need_capacity = state->need_capacity; - smartlist_add(exit_family, chosen_exit); - routerlist_add_family(exit_family, chosen_exit); + if (chosen_exit) { + smartlist_add(exit_family, chosen_exit); + routerlist_add_family(exit_family, chosen_exit); + } if (!entry_guards) entry_guards = smartlist_create(); |