mirror of
https://github.com/tmate-io/tmate.git
synced 2026-07-25 03:47:14 +00:00
Don't leak file descriptors in the rare MSG_VERSION case. From Chris
Johnsen.
This commit is contained in:
parent
ffba21a60c
commit
4901d9ddc8
1 changed files with 2 additions and 0 deletions
|
|
@ -808,6 +808,8 @@ server_client_msg_dispatch(struct client *c)
|
|||
if (imsg.hdr.peerid != PROTOCOL_VERSION) {
|
||||
server_write_client(c, MSG_VERSION, NULL, 0);
|
||||
c->flags |= CLIENT_BAD;
|
||||
if (imsg.fd != -1)
|
||||
close(imsg.fd);
|
||||
imsg_free(&imsg);
|
||||
continue;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue