]> granicus.if.org Git - libevent/commitdiff
sample/https-client: use ERR_remove_*state() when we have them
authorPierce Lopez <pierce.lopez@gmail.com>
Sun, 5 Mar 2017 16:33:44 +0000 (11:33 -0500)
committerAzat Khuzhin <a3at.mail@gmail.com>
Sun, 5 Mar 2017 23:44:58 +0000 (02:44 +0300)
ERR_remove_thread_state:
- openssl 0.9.8         does not have
- openssl 1.0/libressl  has
- openssl 1.1           deprecates

sample/https-client.c

index 723951dd054c079b71880654f8f512eb3fde35e3..8ef75987ba02a3faec388dea84466bca584ba7fd 100644 (file)
@@ -492,7 +492,12 @@ cleanup:
        EVP_cleanup();
        ERR_free_strings();
 
+#if OPENSSL_VERSION_NUMBER < 0x10000000L
+       ERR_remove_state(0);
+#else
        ERR_remove_thread_state(NULL);
+#endif
+
        CRYPTO_cleanup_all_ex_data();
 
        sk_SSL_COMP_free(SSL_COMP_get_compression_methods());