From 47b990f50826a0eb5f5ee47eb57640381c8b4246 Mon Sep 17 00:00:00 2001 From: Tatsuhiro Tsujikawa Date: Mon, 22 Aug 2022 19:06:35 +0900 Subject: [PATCH] Fix errors reported by coverity scan --- src/HttpServer.cc | 2 +- src/shrpx.cc | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/HttpServer.cc b/src/HttpServer.cc index 004bbd3a..afc9e2ef 100644 --- a/src/HttpServer.cc +++ b/src/HttpServer.cc @@ -1805,7 +1805,7 @@ void worker_acceptcb(struct ev_loop *loop, ev_async *w, int revents) { q.swap(worker->q); } - for (auto c : q) { + for (const auto &c : q) { sessions->accept_connection(c.fd); } } diff --git a/src/shrpx.cc b/src/shrpx.cc index 4b9eb58e..b586dc13 100644 --- a/src/shrpx.cc +++ b/src/shrpx.cc @@ -1093,7 +1093,7 @@ std::vector get_inherited_addr_from_env(Config *config) { auto portenv = getenv(ENV_PORT.c_str()); if (portenv) { size_t i = 1; - for (auto env_name : {ENV_LISTENER4_FD, ENV_LISTENER6_FD}) { + for (const auto &env_name : {ENV_LISTENER4_FD, ENV_LISTENER6_FD}) { auto fdenv = getenv(env_name.c_str()); if (fdenv) { auto name = ENV_ACCEPT_PREFIX.str();