Fix errors reported by coverity scan

This commit is contained in:
Tatsuhiro Tsujikawa 2022-08-22 19:06:35 +09:00
parent 68ea085535
commit 47b990f508
2 changed files with 2 additions and 2 deletions

View File

@ -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);
}
}

View File

@ -1093,7 +1093,7 @@ std::vector<InheritedAddr> 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();