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

[or-cvs] Fix idiot bug. The "free the IP history" code belons in co...



Update of /home/or/cvsroot/tor/src/or
In directory moria:/tmp/cvs-serv27862/src/or

Modified Files:
	connection.c 
Log Message:
Fix idiot bug.  The "free the IP history" code belons in connection_free_all(), not in connection_free().  You can all mock me now.

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.390
retrieving revision 1.391
diff -u -d -r1.390 -r1.391
--- connection.c	3 Aug 2005 20:42:17 -0000	1.390
+++ connection.c	4 Aug 2005 18:29:01 -0000	1.391
@@ -255,10 +255,6 @@
   }
   connection_unregister(conn);
   _connection_free(conn);
-
-  SMARTLIST_FOREACH(outgoing_addrs, void*, addr, tor_free(addr));
-  smartlist_free(outgoing_addrs);
-  outgoing_addrs = NULL;
 }
 
 /** Call _connection_free() on every connection in our array, and release all
@@ -278,6 +274,12 @@
   get_connection_array(&carray,&n);
   for (i=0;i<n;i++)
     _connection_free(carray[i]);
+
+  if (outgoing_addrs) {
+    SMARTLIST_FOREACH(outgoing_addrs, void*, addr, tor_free(addr));
+    smartlist_free(outgoing_addrs);
+    outgoing_addrs = NULL;
+  }
 }
 
 /** Do any cleanup needed: