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

[or-cvs] r10318: don't segfault when we're trying to build a testing circ to (tor/branches/tor-0_1_2-patches/src/or)



Author: arma
Date: 2007-05-24 19:38:14 -0400 (Thu, 24 May 2007)
New Revision: 10318

Modified:
   tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c
Log:
don't segfault when we're trying to build a testing circ to ourselves


Modified: tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c
===================================================================
--- tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c	2007-05-24 20:31:30 UTC (rev 10317)
+++ tor/branches/tor-0_1_2-patches/src/or/circuitbuild.c	2007-05-24 23:38:14 UTC (rev 10318)
@@ -2328,8 +2328,10 @@
   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();