mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 16:53:55 -06:00
qemu-ga: for w32, fix leaked handle ov.hEvent in ga_channel_write()
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 <jcody@redhat.com> Acked-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
This commit is contained in:
parent
0c1f781b7c
commit
b71706d122
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue