From b5bbe06f4eae8fe1b7d3d16b8035f46b4fb54648 Mon Sep 17 00:00:00 2001
From: Fabian Keil <fk@fabiankeil.de>
Date: Wed, 23 Sep 2020 10:10:43 +0200
Subject: [PATCH] ssl_release(): Fix build with LibreSSL

... by only calling SSL_COMP_free_compression_methods()
and COMP_zlib_cleanup() if OPENSSL_NO_COMP is undefined.

Briefly tested with LibreSSL 3.1.1 on OpenBSD 6.7.
---
 openssl.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/openssl.c b/openssl.c
index 1bf08d10..7e4e3d8a 100644
--- a/openssl.c
+++ b/openssl.c
@@ -2178,12 +2178,14 @@ extern void ssl_release(void)
 {
    if (ssl_inited == 1)
    {
+#ifndef OPENSSL_NO_COMP
       SSL_COMP_free_compression_methods();
-
+#endif
       CONF_modules_free();
       CONF_modules_unload(1);
-
+#ifndef OPENSSL_NO_COMP
       COMP_zlib_cleanup();
+#endif
 
       ERR_free_strings();
       EVP_cleanup();
-- 
2.49.0