From f6860e0e110a82fe61ce46de4fb5a05794e456ab Mon Sep 17 00:00:00 2001 From: Timo Teräs Date: Thu, 5 Oct 2017 13:30:39 +0300 Subject: libfetch: fix ssl context leak from freebsd --- libfetch/common.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'libfetch/common.c') diff --git a/libfetch/common.c b/libfetch/common.c index 1fbd0d4..3538cc4 100644 --- a/libfetch/common.c +++ b/libfetch/common.c @@ -735,6 +735,20 @@ fetch_close(conn_t *conn) { int ret; +#ifdef WITH_SSL + if (conn->ssl) { + SSL_shutdown(conn->ssl); + SSL_set_connect_state(conn->ssl); + SSL_free(conn->ssl); + } + if (conn->ssl_ctx) { + SSL_CTX_free(conn->ssl_ctx); + } + if (conn->ssl_cert) { + X509_free(conn->ssl_cert); + } +#endif + ret = close(conn->sd); if (conn->cache_url) fetchFreeURL(conn->cache_url); -- cgit v1.2.3-70-g09d2