openssl: Fix (harmless) memory leaks at exit.
[paraslash.git] / configure.ac
index d993e52..f518f89 100644 (file)
@@ -114,6 +114,15 @@ if test $HAVE_OPENSSL = yes; then
        test $HAVE_CRYPTO_CLEANUP_ALL_EX_DATA = yes &&
                AC_DEFINE([HAVE_CRYPTO_CLEANUP_ALL_EX_DATA], [1],
                        [not available on FreeBSD 12])
+       HAVE_OPENSSL_THREAD_STOP=yes
+       AC_CHECK_DECL([OPENSSL_thread_stop], [],
+               [HAVE_OPENSSL_THREAD_STOP=no],
+               [#include <openssl/crypto.h>])
+       AC_CHECK_LIB([crypto], [OPENSSL_thread_stop], [],
+               [HAVE_OPENSSL_THREAD_STOP=no])
+       test $HAVE_OPENSSL_THREAD_STOP = yes &&
+               AC_DEFINE([HAVE_OPENSSL_THREAD_STOP], [1],
+                       [not available on openssl-1.0])
 fi
 UNSTASH_FLAGS
 ######################################################################### gcrypt