]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Cleaner memleak output.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2009 15:30:05 +0000 (15:30 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Mon, 24 Aug 2009 15:30:05 +0000 (15:30 +0000)
git-svn-id: file:///svn/unbound/trunk@1772 be551aaa-1e26-0410-a405-d3ace91eadb9

daemon/daemon.c

index 3b1889909c5408413bc96814096d9a21d036618b..4ebebe07e0240844905ff607acf515bd6d74541c 100644 (file)
@@ -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();