From a413b36fcfcc41e7d818509c66947834d0ab5bbc Mon Sep 17 00:00:00 2001 From: Kamil Dudka Date: Mon, 19 Apr 2021 16:14:35 +0200 Subject: [PATCH] src: prevent Coverity from reporting resource leak ... on allocation of ListenEventHandler: Error: RESOURCE_LEAK (CWE-772): src/HttpServer.cc:2056: alloc_fn: Storage is returned from allocation function "operator new". src/HttpServer.cc:2056: leaked_storage: Ignoring storage allocated by "new nghttp2::ListenEventHandler(sessions, fd, std::shared_ptr(acceptor))" leaks it. --- src/HttpServer.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 5075bc95..4d8c44b6 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -2053,6 +2053,7 @@ int start_listen(HttpServer *sv, struct ev_loop *loop, Sessions *sessions, if (!acceptor) { acceptor = std::make_shared(sv, sessions, config); } + // coverity[leaked_storage] new ListenEventHandler(sessions, fd, acceptor); if (config->verbose) {