[or-cvs] r17061: {tor} minor memory leak found by coverity (tor/trunk/src/or)

arma at seul.org arma at seul.org
Sun Oct 12 03:19:17 UTC 2008


Author: arma
Date: 2008-10-11 23:19:17 -0400 (Sat, 11 Oct 2008)
New Revision: 17061

Modified:
   tor/trunk/src/or/circuitbuild.c
Log:
minor memory leak found by coverity


Modified: tor/trunk/src/or/circuitbuild.c
===================================================================
--- tor/trunk/src/or/circuitbuild.c	2008-10-12 00:54:12 UTC (rev 17060)
+++ tor/trunk/src/or/circuitbuild.c	2008-10-12 03:19:17 UTC (rev 17061)
@@ -1306,8 +1306,7 @@
      * at least one predicted exit port. */
 
     int try;
-    smartlist_t *needed_ports;
-    smartlist_t *supporting = smartlist_create(), *use = smartlist_create();
+    smartlist_t *needed_ports, *supporting, *use;
 
     if (best_support == -1) {
       if (need_uptime || need_capacity) {
@@ -1322,6 +1321,8 @@
       log_notice(LD_CIRC, "All routers are down or won't exit -- choosing a "
                  "doomed exit at random.");
     }
+    supporting = smartlist_create();
+    use = smartlist_create();
     needed_ports = circuit_get_unhandled_ports(time(NULL));
     for (try = 0; try < 2; try++) {
       /* try once to pick only from routers that satisfy a needed port,



More information about the tor-commits mailing list