From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:51270) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9bcb-0002k3-Re for qemu-devel@nongnu.org; Mon, 19 Mar 2012 08:23:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S9bcH-0000D2-Ow for qemu-devel@nongnu.org; Mon, 19 Mar 2012 08:23:33 -0400 Received: from e06smtp17.uk.ibm.com ([195.75.94.113]:54562) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S9bcH-0000CN-GJ for qemu-devel@nongnu.org; Mon, 19 Mar 2012 08:23:13 -0400 Received: from /spool/local by e06smtp17.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Mon, 19 Mar 2012 12:23:09 -0000 Received: from d06av11.portsmouth.uk.ibm.com (d06av11.portsmouth.uk.ibm.com [9.149.37.252]) by d06nrmr1806.portsmouth.uk.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id q2JCN8GT2936924 for ; Mon, 19 Mar 2012 12:23:08 GMT Received: from d06av11.portsmouth.uk.ibm.com (loopback [127.0.0.1]) by d06av11.portsmouth.uk.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id q2JCN7a0012348 for ; Mon, 19 Mar 2012 06:23:07 -0600 From: Stefan Hajnoczi Date: Mon, 19 Mar 2012 12:23:00 +0000 Message-Id: <1332159780-31781-9-git-send-email-stefanha@linux.vnet.ibm.com> In-Reply-To: <1332159780-31781-1-git-send-email-stefanha@linux.vnet.ibm.com> References: <1332159780-31781-1-git-send-email-stefanha@linux.vnet.ibm.com> Subject: [Qemu-devel] [PATCH 8/8] qemu-ga: for w32, fix leaked handle ov.hEvent in ga_channel_write() List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: Jeff Cody , qemu-devel@nongnu.org, Stefan Hajnoczi From: Jeff Cody In the function ga_channel_write(), the handle ov.hEvent is created by the call to CreateEvent(). However, the handle is not closed prior to the function return. This patch closes the handle before the return of the function. Kudos to Paolo Bonzini for spotting this bug. Signed-off-by: Jeff Cody Acked-by: Michael Roth Signed-off-by: Stefan Hajnoczi --- qga/channel-win32.c | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/qga/channel-win32.c b/qga/channel-win32.c index 190251b..16bf44a 100644 --- a/qga/channel-win32.c +++ b/qga/channel-win32.c @@ -259,6 +259,10 @@ static GIOStatus ga_channel_write(GAChannel *c, const char *buf, size_t size, *count = written; } + if (ov.hEvent) { + CloseHandle(ov.hEvent); + ov.hEvent = NULL; + } return status; } -- 1.7.9.1