]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: proto_reverse_connect: fix FD leak upon connect
authorWilliam Lallemand <wlallemand@haproxy.org>
Fri, 29 Sep 2023 22:53:43 +0000 (00:53 +0200)
committerWilliam Lallemand <wlallemand@haproxy.org>
Fri, 29 Sep 2023 22:53:43 +0000 (00:53 +0200)
commitc21ec3b7351c49e6bc6a49983d59701377c75d9b
treeb2dfc4de79de242972b2e21a95a44a85a5ed4313
parentc58fd4d1cce343ccc9e5de213689dd68026f7ed5
BUG/MINOR: proto_reverse_connect: fix FD leak upon connect

new_reverse_conn() is creating its own socket with
sock_create_server_socket(). However the connect is done with
conn->ctrl->connect() which is tcp_connect_server().

tcp_connect_server() is also creating its own socket and sets it in the
struct conn, left the previous socket unclosed and leaking at each
attempt.

This patch fixes the issue by letting tcp_connect_server() handling the
socket part, and removes it in new_reverse_conn().
src/proto_reverse_connect.c