From 5ae205badc7fe6ba4287d8e657f7010ff5ff408c Mon Sep 17 00:00:00 2001 From: Treeki Date: Wed, 12 Feb 2014 13:27:22 +0100 Subject: clean up TLS state --- bouncer/main.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'bouncer') diff --git a/bouncer/main.cpp b/bouncer/main.cpp index b021120..13e1ced 100644 --- a/bouncer/main.cpp +++ b/bouncer/main.cpp @@ -39,6 +39,13 @@ bool initTLS() { return true; } + +void cleanupTLS() { + gnutls_certificate_free_credentials(g_clientCreds); + gnutls_certificate_free_credentials(g_serverCreds); + gnutls_dh_params_deinit(dh_params); + gnutls_global_deinit(); +} #endif int main(int argc, char **argv) { @@ -55,6 +62,11 @@ int main(int argc, char **argv) { int errcode = bounce.execute(); DNS::stop(); + +#ifdef USE_GNUTLS + cleanupTLS(); +#endif + if (errcode < 0) { printf("(Bouncer::execute failed with %d)\n", errcode); return EXIT_FAILURE; -- cgit v1.2.3