mirror of
https://github.com/yrutschle/sslh.git
synced 2025-06-06 10:23:14 +03:00
fix file descriptor leak if bind_peer fails
This commit is contained in:
parent
5666a1bb9d
commit
3707c5b8a6
1
common.c
1
common.c
@ -348,6 +348,7 @@ int connect_addr(struct connection *cnx, int fd_from, connect_blocking blocking)
|
|||||||
|
|
||||||
if (transparent) {
|
if (transparent) {
|
||||||
res = bind_peer(fd, fd_from);
|
res = bind_peer(fd, fd_from);
|
||||||
|
if (res == -1) close(fd);
|
||||||
CHECK_RES_RETURN(res, "bind_peer", res);
|
CHECK_RES_RETURN(res, "bind_peer", res);
|
||||||
}
|
}
|
||||||
res = connect(fd, a->ai_addr, a->ai_addrlen);
|
res = connect(fd, a->ai_addr, a->ai_addrlen);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user