]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix to unload gost dynamic library module for leak test.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jun 2010 12:27:19 +0000 (12:27 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Tue, 22 Jun 2010 12:27:19 +0000 (12:27 +0000)
git-svn-id: file:///svn/unbound/trunk@2161 be551aaa-1e26-0410-a405-d3ace91eadb9

config.h.in
configure
configure.ac
daemon/daemon.c
doc/Changelog
ldns-src.tar.gz
testcode/testbound.c
testcode/unitmain.c

index f98a5c69bfc1d1a64202cc08627d5f6c76964487..b5d2eb3c385d80bdcb3c86a6760352ee954cf17a 100644 (file)
 /* Define to 1 if you have the `kill' function. */
 #undef HAVE_KILL
 
+/* Define to 1 if you have the `ldns_key_EVP_unload_gost' function. */
+#undef HAVE_LDNS_KEY_EVP_UNLOAD_GOST
+
 /* Define to 1 if you have the <ldns/ldns.h> header file. */
 #undef HAVE_LDNS_LDNS_H
 
index 1a4d318a28b629de2537929a3b584ac79c011fb3..7608974fd0de04598fa41d3b465c1f80ab5c4f06 100755 (executable)
--- a/configure
+++ b/configure
@@ -16360,6 +16360,17 @@ if test "x$ac_cv_func_ldns_key_EVP_load_gost_id" = x""yes; then :
 
 fi
 
+           for ac_func in ldns_key_EVP_unload_gost
+do :
+  ac_fn_c_check_func "$LINENO" "ldns_key_EVP_unload_gost" "ac_cv_func_ldns_key_EVP_unload_gost"
+if test "x$ac_cv_func_ldns_key_EVP_unload_gost" = x""yes; then :
+  cat >>confdefs.h <<_ACEOF
+#define HAVE_LDNS_KEY_EVP_UNLOAD_GOST 1
+_ACEOF
+
+fi
+done
+
        else
            ac_cv_func_ldns_key_EVP_load_gost_id="yes"
        fi
index 31ebe9c6af7d48bce1bf25d5435d10024853e6e0..538a5eafcd570ec80a1a35f6f9ad47d02870d4b8 100644 (file)
@@ -639,6 +639,7 @@ if test "$use_ldns_builtin" = "no"; then
        AC_CHECK_FUNC(ldns_b32_ntop_extended_hex)
        if test x$use_gost = xyes; then
            AC_CHECK_FUNC(ldns_key_EVP_load_gost_id)
+           AC_CHECK_FUNCS([ldns_key_EVP_unload_gost])
        else
            ac_cv_func_ldns_key_EVP_load_gost_id="yes"
        fi
index 5657a8b2ed7a32ee95aaf979166f96d4c65e4337..2ab96b50497717db0308a607dd4748232b788356 100644 (file)
@@ -532,6 +532,9 @@ daemon_delete(struct daemon* daemon)
        ub_c_lex_destroy();
 #endif
        /* libcrypto cleanup */
+#if defined(USE_GOST) && defined(HAVE_LDNS_KEY_EVP_UNLOAD_GOST)
+       ldns_key_EVP_unload_gost();
+#endif
 #if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS
        sk_SSL_COMP_free(comp_meth);
 #endif
index 5aa99ec0c8b3164715c4cc449ceae62ff9c5edf8..88b28f13692167a4eae7855f31e2281b0b69d5c5 100644 (file)
@@ -1,5 +1,6 @@
 22 June 2010: Wouter
        - Unbound reports libev or libevent correctly in logs in verbose mode.
+       - Fix to unload gost dynamic library module for leak testing.
 
 18 June 2010: Wouter
        - iana portlist updated.
index 3f8ebc640359871b3d6ac007e428ee8195ce8af2..da46f5e4d09553ef961e4e3c31eff0237f3d5110 100644 (file)
Binary files a/ldns-src.tar.gz and b/ldns-src.tar.gz differ
index f61eea9bdfc3a160e603a06c0403287ab466a9dd..18e0d98b8c46777893fc4f828b019cdd3d9e9440 100644 (file)
@@ -339,8 +339,13 @@ main(int argc, char* argv[])
        fake_event_cleanup();
        for(c=1; c<pass_argc; c++)
                free(pass_argv[c]);
-       if(res == 0)
+       if(res == 0) {
                log_info("Testbound Exit Success");
+#ifdef HAVE_PTHREAD
+               /* dlopen frees its thread state (dlopen of gost engine) */
+               pthread_exit(NULL);
+#endif
+       }
        return res;
 }
 
index d4750df654ec77249f802341f8ae3c24c37b7bb1..6258316c9f4bb3dee28e5c07ebecce4ed93e4e2b 100644 (file)
@@ -522,6 +522,9 @@ main(int argc, char* argv[])
        msgparse_test();
        checklock_stop();
        printf("%d checks ok.\n", testcount);
+#if defined(USE_GOST) && defined(HAVE_LDNS_KEY_EVP_UNLOAD_GOST)
+       ldns_key_EVP_unload_gost();
+#endif
 #ifdef HAVE_OPENSSL_CONFIG
        EVP_cleanup();
        ENGINE_cleanup();
@@ -531,5 +534,9 @@ main(int argc, char* argv[])
        ERR_remove_state(0);
        ERR_free_strings();
        RAND_cleanup();
+#ifdef HAVE_PTHREAD
+       /* dlopen frees its thread specific state */
+       pthread_exit(NULL);
+#endif
        return 0;
 }