mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-19 10:14:41 +00:00
BUG/MINOR: sock: Unclosed fd in case of connection allocation failure
If allocating a connection object failed right after a successful accept on a listener, the new file descriptor was not properly closed. This fixes GitHub issue #905. It can be backported to 2.3.
This commit is contained in:
parent
1cdc028687
commit
25dd0ad123
@ -161,6 +161,9 @@ struct connection *sock_accept_conn(struct listener *l, int *status)
|
||||
|
||||
fail_conn:
|
||||
sockaddr_free(&addr);
|
||||
/* The accept call already succeeded by the time we try to allocate the connection,
|
||||
* we need to close it in case of failure. */
|
||||
close(cfd);
|
||||
fail_addr:
|
||||
ret = CO_AC_PAUSE;
|
||||
goto done;
|
||||
|
Loading…
Reference in New Issue
Block a user