aboutsummaryrefslogtreecommitdiff
path: root/src/common/tortls.c
diff options
context:
space:
mode:
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>