From 8f6c0c32b8e4505af5fdbb82d059c25f98586713 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Tue, 12 Apr 2022 07:49:11 +0200 Subject: [PATCH] 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. --- src/sock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/sock.c b/src/sock.c index 5afa59f33..7ccdbd3ba 100644 --- a/src/sock.c +++ b/src/sock.c @@ -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);