From 78ed2ec08a6b06760e0ffb0d9a25ffe06c3eb63d Mon Sep 17 00:00:00 2001 From: Wouter Wijngaards Date: Mon, 24 Aug 2009 15:30:05 +0000 Subject: [PATCH] Cleaner memleak output. git-svn-id: file:///svn/unbound/trunk@1772 be551aaa-1e26-0410-a405-d3ace91eadb9 --- daemon/daemon.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/daemon/daemon.c b/daemon/daemon.c index 3b1889909..4ebebe07e 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -63,6 +63,9 @@ static int sig_record_quit = 0; /** How many reload requests happened. */ static int sig_record_reload = 0; +/** cleaner ssl memory freeup */ +static void* comp_meth = NULL; + /** used when no other sighandling happens, so we don't die * when multiple signals in quick succession are sent to us. * @param sig: signal number. @@ -172,6 +175,8 @@ daemon_init() (void)ldns_key_EVP_load_gost_id(); #endif OpenSSL_add_all_algorithms(); + /* grab the COMP method ptr because openssl leaks it */ + comp_meth = SSL_COMP_get_compression_methods(); (void)SSL_library_init(); #ifdef HAVE_TZSET /* init timezone info while we are not chrooted yet */ @@ -499,6 +504,7 @@ daemon_delete(struct daemon* daemon) free(daemon->env); free(daemon); /* libcrypto cleanup */ + sk_SSL_COMP_free(comp_meth); #ifdef HAVE_OPENSSL_CONFIG EVP_cleanup(); ENGINE_cleanup();