From: William Dauchy Date: Sun, 18 Oct 2020 16:37:43 +0000 (+0200) Subject: BUG/MINOR: listener: close before free in `listener_accept` X-Git-Tag: v2.3-dev8~38 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=835712ad909fe1b36ee53f521d17bbc0a5df3794;p=thirdparty%2Fhaproxy.git BUG/MINOR: listener: close before free in `listener_accept` safer to close handle before the object is put back in the global pool. this was introduced by commit 9378bbe0bef4005155d ("MEDIUM: listener: use protocol->accept_conn() to accept a connection") this should fix github issue #902 no backport needed. Signed-off-by: William Dauchy --- diff --git a/src/listener.c b/src/listener.c index 85191f50ba..7061f9a9da 100644 --- a/src/listener.c +++ b/src/listener.c @@ -855,8 +855,8 @@ void listener_accept(struct listener *l) send_log(p, LOG_EMERG, "Proxy %s reached the configured maximum connection limit. Please check the global 'maxconn' value.\n", p->id); - conn_free(cli_conn); close(cli_conn->handle.fd); + conn_free(cli_conn); expire = tick_add(now_ms, 1000); /* try again in 1 second */ goto limit_global; }