diff options
author | Nick Mathewson <nickm@torproject.org> | 2005-02-11 01:41:19 +0000 |
---|---|---|
committer | Nick Mathewson <nickm@torproject.org> | 2005-02-11 01:41:19 +0000 |
commit | 5d836c81408142519d3d5791b95c908c5240b3b7 (patch) | |
tree | 157b1b1985eec0248a9348d07cf1689f0b82fd55 /src/common/tortls.c | |
parent | f672577bc6d32ecfe96582b463a83cac8eaac66f (diff) | |
download | tor-5d836c81408142519d3d5791b95c908c5240b3b7.tar.gz tor-5d836c81408142519d3d5791b95c908c5240b3b7.zip |
Free tls resources on exit too
svn:r3615
Diffstat (limited to 'src/common/tortls.c')
-rw-r--r-- | src/common/tortls.c | 11 |
1 files changed, 11 insertions, 0 deletions
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. |