BUG/MINOR: sock: do not double-close the accepted socket on the error path

Coverity found in issue #1646 that I added a double-close bug in last
commit e4d09cedb ("MINOR: sock: check configured limits at the sock layer,
not the listener's") because the error path already closes the FD. No
backport needed.
This commit is contained in:
Willy Tarreau 2022-04-12 07:49:11 +02:00
parent ce7a5e0967
commit 8f6c0c32b8

View File

@ -104,7 +104,6 @@ struct connection *sock_accept_conn(struct listener *l, int *status)
if (likely(cfd != -1)) {
if (unlikely(cfd >= global.maxsock)) {
close(cfd);
send_log(p, LOG_EMERG,
"Proxy %s reached the configured maximum connection limit. Please check the global 'maxconn' value.\n",
p->id);