From dc5bbbc5f0892d37bf947339997e10917992038f Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Fri, 8 Dec 2017 14:17:17 +0900 Subject: [PATCH] ssl: remove unreachable code GetSSLCTX() never returns NULL. --- ext/openssl/ossl_ssl.c | 9 --------- 1 file changed, 9 deletions(-) diff --git a/ext/openssl/ossl_ssl.c b/ext/openssl/ossl_ssl.c index 736f49243..c6bfb8312 100644 --- a/ext/openssl/ossl_ssl.c +++ b/ext/openssl/ossl_ssl.c @@ -996,12 +996,7 @@ ossl_sslctx_get_ciphers(VALUE self) int i, num; GetSSLCTX(self, ctx); - if(!ctx){ - rb_warning("SSL_CTX is not initialized."); - return Qnil; - } ciphers = SSL_CTX_get_ciphers(ctx); - if (!ciphers) return rb_ary_new(); @@ -1049,10 +1044,6 @@ ossl_sslctx_set_ciphers(VALUE self, VALUE v) } GetSSLCTX(self, ctx); - if(!ctx){ - ossl_raise(eSSLError, "SSL_CTX is not initialized."); - return Qnil; - } if (!SSL_CTX_set_cipher_list(ctx, StringValueCStr(str))) { ossl_raise(eSSLError, "SSL_CTX_set_cipher_list"); }