[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 8/8] qemu-ga: for w32, fix leaked handle ov.hEvent i
From: |
Stefan Hajnoczi |
Subject: |
[Qemu-devel] [PATCH 8/8] qemu-ga: for w32, fix leaked handle ov.hEvent in ga_channel_write() |
Date: |
Mon, 19 Mar 2012 12:23:00 +0000 |
From: Jeff Cody <address@hidden>
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 <address@hidden>
Acked-by: Michael Roth <address@hidden>
Signed-off-by: Stefan Hajnoczi <address@hidden>
---
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
- [Qemu-devel] [PULL 0/8] Trivial patches for 8 to 19 March 2012, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 3/8] ds1338: Add missing break statement, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 8/8] qemu-ga: for w32, fix leaked handle ov.hEvent in ga_channel_write(),
Stefan Hajnoczi <=
- [Qemu-devel] [PATCH 7/8] ioapic: fix build with DEBUG_IOAPIC, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 2/8] vnc: Fix packed boolean struct members, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 5/8] cleanup obsolete typedef, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 6/8] .gitignore: add qemu-bridge-helper and option rom build products, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 4/8] monitor: Remove unused bool field 'qapi' in mon_cmd_t struct, Stefan Hajnoczi, 2012/03/19
- [Qemu-devel] [PATCH 1/8] Remove type field in ModuleEntry as it's not used, Stefan Hajnoczi, 2012/03/19
- Re: [Qemu-devel] [PULL 0/8] Trivial patches for 8 to 19 March 2012, Anthony Liguori, 2012/03/19