aboutsummaryrefslogtreecommitdiff
path: root/src/common/tortls.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2005-02-28 02:52:51 +0000
committerNick Mathewson <nickm@torproject.org>2005-02-28 02:52:51 +0000
commit97bc49bd72c20bf6ffae16e30941ccd7c15089d0 (patch)
treedd3310aeb5bfe662e7c89d601a5c611d9af5bda6 /src/common/tortls.c
parent0a2be3c9d83f86b1891bfca8b55d9b280007be79 (diff)
downloadtor-97bc49bd72c20bf6ffae16e30941ccd7c15089d0.tar
tor-97bc49bd72c20bf6ffae16e30941ccd7c15089d0.tar.gz
Try a little harder to avoid openssl SSL* double-free reports.
svn:r3710
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r--src/common/tortls.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/common/tortls.c b/src/common/tortls.c
index 2ab3771f3..191a82519 100644
--- a/src/common/tortls.c
+++ b/src/common/tortls.c
@@ -436,8 +436,10 @@ tor_tls_new(int sock, int isServer, int use_no_cert)
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>