diff --git a/web/server/h2o/http_server.c b/web/server/h2o/http_server.c
index 1f0a14ff29..9abb0ca050 100644
--- a/web/server/h2o/http_server.c
+++ b/web/server/h2o/http_server.c
@@ -73,6 +73,10 @@ static int ssl_init()
 #else
     accept_ctx.ssl_ctx = SSL_CTX_new(TLS_server_method());
 #endif
+    if (!accept_ctx.ssl_ctx) {
+        netdata_log_error("Could not allocate a new SSL_CTX");
+        return -1;
+    }
 
     SSL_CTX_set_options(accept_ctx.ssl_ctx, SSL_OP_NO_SSLv2);