summaryrefslogtreecommitdiff
path: root/usr.sbin/relayd
diff options
context:
space:
mode:
authorDavid Hill <dhill@cvs.openbsd.org>2010-10-12 14:52:22 +0000
committerDavid Hill <dhill@cvs.openbsd.org>2010-10-12 14:52:22 +0000
commit6e3e16e5c7d0629440f127f2d2ba7e87cc9a38d8 (patch)
tree624a9aded15f62bde87ccea060467100b78296b1 /usr.sbin/relayd
parentc2672c01f315bec8cfcd3213bc39c3ebba8c5071 (diff)
Plug a significant memory leak when using SSL.
ok claudio@, jsg@, phessler@
Diffstat (limited to 'usr.sbin/relayd')
-rw-r--r--usr.sbin/relayd/relay.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/usr.sbin/relayd/relay.c b/usr.sbin/relayd/relay.c
index dcd1e5863f1..c421e851ffc 100644
--- a/usr.sbin/relayd/relay.c
+++ b/usr.sbin/relayd/relay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: relay.c,v 1.122 2010/08/01 22:18:35 sthen Exp $ */
+/* $OpenBSD: relay.c,v 1.123 2010/10/12 14:52:21 dhill Exp $ */
/*
* Copyright (c) 2006, 2007, 2008 Reyk Floeter <reyk@openbsd.org>
@@ -2400,6 +2400,12 @@ relay_close(struct rsession *con, const char *msg)
bufferevent_free(con->se_out.bev);
else if (con->se_out.output != NULL)
evbuffer_free(con->se_out.output);
+ if (con->se_out.ssl != NULL) {
+ /* XXX handle non-blocking shutdown */
+ if (SSL_shutdown(con->se_out.ssl) == 0)
+ SSL_shutdown(con->se_out.ssl);
+ SSL_free(con->se_out.ssl);
+ }
if (con->se_out.s != -1)
close(con->se_out.s);
if (con->se_out.path != NULL)