summaryrefslogtreecommitdiff
path: root/bouncer
diff options
context:
space:
mode:
authorTreeki <treeki@gmail.com>2014-02-12 13:27:22 +0100
committerTreeki <treeki@gmail.com>2014-02-12 13:27:22 +0100
commit5ae205badc7fe6ba4287d8e657f7010ff5ff408c (patch)
tree3e1033b24730a13b62e080b1fcca17e4949e58f5 /bouncer
parentd3856992710194330bae59210c4ca6154259ecdc (diff)
downloadbounce4-5ae205badc7fe6ba4287d8e657f7010ff5ff408c.tar.gz
bounce4-5ae205badc7fe6ba4287d8e657f7010ff5ff408c.zip
clean up TLS state
Diffstat (limited to 'bouncer')
-rw-r--r--bouncer/main.cpp12
1 files changed, 12 insertions, 0 deletions
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;