mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2025-08-06 23:27:04 +02:00
BUG: tcp: close socket fd upon connect error
When the data layer fails to initialize (eg: out of memory for SSL), we must close the socket fd we just allocated.
This commit is contained in:
parent
403edff4b8
commit
184636e3e7
@ -459,8 +459,10 @@ int tcp_connect_server(struct connection *conn, int data)
|
|||||||
fd_insert(fd);
|
fd_insert(fd);
|
||||||
conn_sock_want_send(conn); /* for connect status */
|
conn_sock_want_send(conn); /* for connect status */
|
||||||
|
|
||||||
if (conn_data_init(conn) < 0)
|
if (conn_data_init(conn) < 0) {
|
||||||
|
fd_delete(fd);
|
||||||
return SN_ERR_RESOURCE;
|
return SN_ERR_RESOURCE;
|
||||||
|
}
|
||||||
|
|
||||||
if (data)
|
if (data)
|
||||||
conn_data_want_send(conn); /* prepare to send data if any */
|
conn_data_want_send(conn); /* prepare to send data if any */
|
||||||
|
Loading…
Reference in New Issue
Block a user