[or-cvs] Per comments at the bottom of openssl/FAQ, call even more f...

Nick Mathewson nickm at seul.org
Tue Oct 25 19:01:50 UTC 2005


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

Modified Files:
	cpuworker.c dns.c 
Log Message:
Per comments at the bottom of openssl/FAQ, call even more functions to
clean up OpenSSL's toys when it's done playing.  (Why isn't there an
OpenSSL_free_everything() function?)



Index: cpuworker.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/cpuworker.c,v
retrieving revision 1.90
retrieving revision 1.91
diff -u -d -r1.90 -r1.91
--- cpuworker.c	25 Oct 2005 18:01:01 -0000	1.90
+++ cpuworker.c	25 Oct 2005 19:01:48 -0000	1.91
@@ -290,6 +290,7 @@
   if (last_onion_key)
     crypto_free_pk_env(last_onion_key);
   tor_close_socket(fd);
+  crypto_thread_cleanup();
   spawn_exit();
   return 0; /* windows wants this function to return an int */
 }

Index: dns.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/or/dns.c,v
retrieving revision 1.172
retrieving revision 1.173
diff -u -d -r1.172 -r1.173
--- dns.c	25 Oct 2005 18:01:01 -0000	1.172
+++ dns.c	25 Oct 2005 19:01:48 -0000	1.173
@@ -793,12 +793,14 @@
         info(LD_EXIT,"(Error on %d was %s)", fd, tor_socket_strerror(tor_socket_errno(fd)));
       }
       tor_close_socket(fd);
+      crypto_thread_cleanup();
       spawn_exit();
     }
 
     if (address_len && read_all(fd, address, address_len, 1) != address_len) {
       err(LD_BUG,"read hostname failed. Child exiting.");
       tor_close_socket(fd);
+      crypto_thread_cleanup();
       spawn_exit();
     }
     address[address_len] = 0; /* null terminate it */
@@ -826,6 +828,7 @@
     if (write_all(fd, answer, 5, 1) != 5) {
       err(LD_NET,"writing answer failed. Child exiting.");
       tor_close_socket(fd);
+      crypto_thread_cleanup();
       spawn_exit();
     }
   }



More information about the tor-commits mailing list