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<nghttp2::AcceptHandler>(acceptor))" leaks it.
This commit is contained in:
Kamil Dudka 2021-04-19 16:14:35 +02:00
parent 20079b4c2f
commit a413b36fcf
1 changed files with 1 additions and 0 deletions

View File

@ -2053,6 +2053,7 @@ int start_listen(HttpServer *sv, struct ev_loop *loop, Sessions *sessions,
if (!acceptor) {
acceptor = std::make_shared<AcceptHandler>(sv, sessions, config);
}
// coverity[leaked_storage]
new ListenEventHandler(sessions, fd, acceptor);
if (config->verbose) {