summaryrefslogtreecommitdiffstats
path: root/crypto/comp
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-02-10 13:59:15 +0000
committerMatt Caswell <matt@openssl.org>2016-02-10 17:40:59 +0000
commit0fc32b0718ec210e03b6d8623d4819ed04615a1b (patch)
tree9491a02a740d05b415790bcfeb16eb65f6a06267 /crypto/comp
parent8bd8221be80708825ddb9771d4c9fff67860119b (diff)
The new init functions can now fail so shouldn't be void
The new init functions can fail if the library has already been stopped. We should be able to indicate failure with a 0 return value. Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/comp')
-rw-r--r--crypto/comp/c_zlib.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/crypto/comp/c_zlib.c b/crypto/comp/c_zlib.c
index 619765ceff..baad9c66ee 100644
--- a/crypto/comp/c_zlib.c
+++ b/crypto/comp/c_zlib.c
@@ -289,9 +289,13 @@ COMP_METHOD *COMP_zlib(void)
&& p_inflateInit_ && p_deflateEnd
&& p_deflate && p_deflateInit_ && p_zError)
zlib_loaded++;
+
+ if (!OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL)) {
+ COMP_zlib_cleanup();
+ return meth;
+ }
if (zlib_loaded)
meth = &zlib_stateful_method;
- OPENSSL_init_crypto(OPENSSL_INIT_ZLIB, NULL);
}
}
#endif