From f2fde180cdcca1f0a1c12d097c92510a887f6500 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 19 Aug 2019 22:27:32 +0900 Subject: [PATCH] Remove redundant null check before delete Reported in https://github.com/nghttp2/nghttp2/issues/1384 --- src/shrpx_connection_handler.cc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/shrpx_connection_handler.cc b/src/shrpx_connection_handler.cc index 5259d4d3..84221ba7 100644 --- a/src/shrpx_connection_handler.cc +++ b/src/shrpx_connection_handler.cc @@ -159,9 +159,7 @@ ConnectionHandler::~ConnectionHandler() { for (auto ssl_ctx : all_ssl_ctx_) { auto tls_ctx_data = static_cast(SSL_CTX_get_app_data(ssl_ctx)); - if (tls_ctx_data) { - delete tls_ctx_data; - } + delete tls_ctx_data; SSL_CTX_free(ssl_ctx); }