From 0b231df2af8e9bf29dc51be87068e923844faca6 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Fri, 11 Oct 2013 08:07:13 +0000 Subject: Don't leak file descriptors in the rare MSG_VERSION case. From Chris Johnsen. --- usr.bin/tmux/server-client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/usr.bin/tmux/server-client.c b/usr.bin/tmux/server-client.c index 10eb95e0579..a1c41af0374 100644 --- a/usr.bin/tmux/server-client.c +++ b/usr.bin/tmux/server-client.c @@ -1,4 +1,4 @@ -/* $OpenBSD: server-client.c,v 1.111 2013/10/10 12:29:35 nicm Exp $ */ +/* $OpenBSD: server-client.c,v 1.112 2013/10/11 08:07:12 nicm Exp $ */ /* * Copyright (c) 2009 Nicholas Marriott @@ -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; } -- cgit v1.2.3