[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/common
In directory moria.mit.edu:/tmp/cvs-serv7198/src/common

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

Index: tortls.c
===================================================================
RCS file: /home/or/cvsroot/tor/src/common/tortls.c,v
retrieving revision 1.87
retrieving revision 1.88
diff -u -d -r1.87 -r1.88
--- tortls.c	28 Feb 2005 01:55:09 -0000	1.87
+++ tortls.c	28 Feb 2005 02:52:51 -0000	1.88
@@ -436,8 +436,10 @@
 void
 tor_tls_free(tor_tls *tls)
 {
+  tor_assert(tls && tls->ssl);
   SSL_free(tls->ssl);
-  free(tls);
+  tls->ssl = NULL;
+  tor_free(tls);
 }
 
 /** Underlying function for TLS reading.  Reads up to <b>len</b>