From: Wouter Wijngaards Date: Wed, 23 Jun 2010 07:46:46 +0000 (+0000) Subject: Fix for clean SSL exit. X-Git-Tag: release-1.4.6rc1~35 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5c0fe2154f463ce6ffe3f66b30d2e7250aae2933;p=thirdparty%2Funbound.git Fix for clean SSL exit. git-svn-id: file:///svn/unbound/trunk@2164 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/config.h.in b/config.h.in index b5d2eb3c3..ae9c841bb 100644 --- a/config.h.in +++ b/config.h.in @@ -37,6 +37,10 @@ /* Define to 1 if you have the `daemon' function. */ #undef HAVE_DAEMON +/* Define to 1 if you have the declaration of `sk_SSL_COMP_pop_free', and to 0 + if you don't. */ +#undef HAVE_DECL_SK_SSL_COMP_POP_FREE + /* Define to 1 if you have the declaration of `SSL_COMP_get_compression_methods', and to 0 if you don't. */ #undef HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS diff --git a/configure b/configure index 7608974fd..120748c10 100755 --- a/configure +++ b/configure @@ -15190,6 +15190,36 @@ fi cat >>confdefs.h <<_ACEOF #define HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS $ac_have_decl _ACEOF +ac_fn_c_check_decl "$LINENO" "sk_SSL_COMP_pop_free" "ac_cv_have_decl_sk_SSL_COMP_pop_free" " +$ac_includes_default +#ifdef HAVE_OPENSSL_ERR_H +#include +#endif + +#ifdef HAVE_OPENSSL_RAND_H +#include +#endif + +#ifdef HAVE_OPENSSL_CONF_H +#include +#endif + +#ifdef HAVE_OPENSSL_ENGINE_H +#include +#endif +#include +#include + +" +if test "x$ac_cv_have_decl_sk_SSL_COMP_pop_free" = x""yes; then : + ac_have_decl=1 +else + ac_have_decl=0 +fi + +cat >>confdefs.h <<_ACEOF +#define HAVE_DECL_SK_SSL_COMP_POP_FREE $ac_have_decl +_ACEOF # Check whether --enable-sha2 was given. diff --git a/configure.ac b/configure.ac index 538a5eafc..dfb160f3c 100644 --- a/configure.ac +++ b/configure.ac @@ -394,7 +394,7 @@ ACX_LIB_SSL AC_CHECK_HEADERS([openssl/conf.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_HEADERS([openssl/engine.h],,, [AC_INCLUDES_DEFAULT]) AC_CHECK_FUNCS([OPENSSL_config EVP_sha1 EVP_sha256 EVP_sha512]) -AC_CHECK_DECLS([SSL_COMP_get_compression_methods], [], [], [ +AC_CHECK_DECLS([SSL_COMP_get_compression_methods,sk_SSL_COMP_pop_free], [], [], [ AC_INCLUDES_DEFAULT #ifdef HAVE_OPENSSL_ERR_H #include diff --git a/daemon/daemon.c b/daemon/daemon.c index 2ab96b504..6f22620ee 100644 --- a/daemon/daemon.c +++ b/daemon/daemon.c @@ -535,8 +535,10 @@ daemon_delete(struct daemon* daemon) #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); +#if HAVE_DECL_SSL_COMP_GET_COMPRESSION_METHODS && HAVE_DECL_SK_SSL_COMP_POP_FREE +#ifndef S_SPLINT_S + sk_SSL_COMP_pop_free(comp_meth, (void*)CRYPTO_free); +#endif #endif #ifdef HAVE_OPENSSL_CONFIG EVP_cleanup();