mirror of
https://github.com/tmux/tmux.git
synced 2025-09-03 22:43:58 +00:00
Don't leak file descriptors in the rare MSG_VERSION case. From Chris
Johnsen.
This commit is contained in:
@ -808,6 +808,8 @@ server_client_msg_dispatch(struct client *c)
|
|||||||
if (imsg.hdr.peerid != PROTOCOL_VERSION) {
|
if (imsg.hdr.peerid != PROTOCOL_VERSION) {
|
||||||
server_write_client(c, MSG_VERSION, NULL, 0);
|
server_write_client(c, MSG_VERSION, NULL, 0);
|
||||||
c->flags |= CLIENT_BAD;
|
c->flags |= CLIENT_BAD;
|
||||||
|
if (imsg.fd != -1)
|
||||||
|
close(imsg.fd);
|
||||||
imsg_free(&imsg);
|
imsg_free(&imsg);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user