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

[or-cvs] Try a little harder to avoid openssl SSL* double-free repor...



Update of /home/or/cvsroot/tor/src/or
In directory moria.mit.edu:/tmp/cvs-serv7198/src/or

Modified Files:
	connection.c main.c 
Log Message:
Try a little harder to avoid openssl SSL* double-free reports.

Index: connection.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/connection.c,v
retrieving revision 1.331
retrieving revision 1.332
diff -u -d -r1.331 -r1.332
--- connection.c	25 Feb 2005 05:42:01 -0000	1.331
+++ connection.c	28 Feb 2005 02:52:51 -0000	1.332
@@ -170,8 +170,10 @@
   if (connection_speaks_cells(conn)) {
     if (conn->state == OR_CONN_STATE_OPEN)
       directory_set_dirty();
-    if (conn->tls)
+    if (conn->tls) {
       tor_tls_free(conn->tls);
+      conn->tls = NULL;
+    }
   }
 
   if (conn->identity_pkey)

Index: main.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/main.c,v
retrieving revision 1.453
retrieving revision 1.454
diff -u -d -r1.453 -r1.454
--- main.c	28 Feb 2005 01:59:18 -0000	1.453
+++ main.c	28 Feb 2005 02:52:51 -0000	1.454
@@ -1276,10 +1276,10 @@
    * unlink, nothing we could do about it anyways. */
   if (options->PidFile && options->command == CMD_RUN_TOR)
     unlink(options->PidFile);
-  crypto_global_cleanup();
   if (accounting_is_enabled(options))
     accounting_record_bandwidth_usage(time(NULL));
   tor_free_all(); /* move tor_free_all back into the ifdef below later. XXX*/
+  crypto_global_cleanup();
 #ifdef USE_DMALLOC
   dmalloc_log_unfreed();
   dmalloc_shutdown();