From 5d836c81408142519d3d5791b95c908c5240b3b7 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 11 Feb 2005 01:41:19 +0000 Subject: Free tls resources on exit too svn:r3615 --- src/common/tortls.c | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/common/tortls.c') diff --git a/src/common/tortls.c b/src/common/tortls.c index 86cdcec48f..42074cc41a 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -156,6 +156,17 @@ tor_tls_init(void) { } } +void +tor_tls_free_all(void) +{ + if (global_tls_context) { + SSL_CTX_free(global_tls_context->ctx); + SSL_CTX_free(global_tls_context->client_only_ctx); + tor_free(global_tls_context); + global_tls_context = NULL; + } +} + /** We need to give OpenSSL a callback to verify certificates. This is * it: We always accept peer certs and complete the handshake. We * don't validate them until later. -- cgit v1.2.3-54-g00ecf