* [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32
@ 2014-06-05 19:41 Michael Roth
2014-06-05 19:41 ` [Qemu-devel] [PATCH] qga: Fix handle fd leak in acquire_privilege() Michael Roth
2014-06-05 22:04 ` [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Peter Maydell
0 siblings, 2 replies; 3+ messages in thread
From: Michael Roth @ 2014-06-05 19:41 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, arei.gonglei, qemu-stable
The following changes since commit e00fcfeab3d452cba3d0a08991a39ab15df66424:
Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging (2014-06-03 14:37:43 +0100)
are available in the git repository at:
git://github.com/mdroth/qemu.git qga-pull-2014-06-05
for you to fetch changes up to 374044f08fe18a18469b981812cd8695f5b3569c:
qga: Fix handle fd leak in acquire_privilege() (2014-06-03 15:07:59 -0500)
----------------------------------------------------------------
Gonglei (1):
qga: Fix handle fd leak in acquire_privilege()
qga/commands-win32.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
^ permalink raw reply [flat|nested] 3+ messages in thread
* [Qemu-devel] [PATCH] qga: Fix handle fd leak in acquire_privilege()
2014-06-05 19:41 [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Michael Roth
@ 2014-06-05 19:41 ` Michael Roth
2014-06-05 22:04 ` [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Michael Roth @ 2014-06-05 19:41 UTC (permalink / raw)
To: qemu-devel; +Cc: peter.maydell, arei.gonglei, qemu-stable
From: Gonglei <arei.gonglei@huawei.com>
token should be closed in all conditions.
So move CloseHandle(token) to "out" branch.
Signed-off-by: Wang Rui <moon.wangrui@huawei.com>
Signed-off-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
---
qga/commands-win32.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index d793dd0..e769396 100644
--- a/qga/commands-win32.c
+++ b/qga/commands-win32.c
@@ -31,7 +31,7 @@
static void acquire_privilege(const char *name, Error **errp)
{
- HANDLE token;
+ HANDLE token = NULL;
TOKEN_PRIVILEGES priv;
Error *local_err = NULL;
@@ -53,13 +53,15 @@ static void acquire_privilege(const char *name, Error **errp)
goto out;
}
- CloseHandle(token);
} else {
error_set(&local_err, QERR_QGA_COMMAND_FAILED,
"failed to open privilege token");
}
out:
+ if (token) {
+ CloseHandle(token);
+ }
if (local_err) {
error_propagate(errp, local_err);
}
--
1.9.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32
2014-06-05 19:41 [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Michael Roth
2014-06-05 19:41 ` [Qemu-devel] [PATCH] qga: Fix handle fd leak in acquire_privilege() Michael Roth
@ 2014-06-05 22:04 ` Peter Maydell
1 sibling, 0 replies; 3+ messages in thread
From: Peter Maydell @ 2014-06-05 22:04 UTC (permalink / raw)
To: Michael Roth; +Cc: Gonglei (Arei), QEMU Developers, qemu-stable
On 5 June 2014 20:41, Michael Roth <mdroth@linux.vnet.ibm.com> wrote:
> The following changes since commit e00fcfeab3d452cba3d0a08991a39ab15df66424:
>
> Merge remote-tracking branch 'remotes/awilliam/tags/vfio-pci-for-qemu-20140602.0' into staging (2014-06-03 14:37:43 +0100)
>
> are available in the git repository at:
>
>
> git://github.com/mdroth/qemu.git qga-pull-2014-06-05
>
> for you to fetch changes up to 374044f08fe18a18469b981812cd8695f5b3569c:
>
> qga: Fix handle fd leak in acquire_privilege() (2014-06-03 15:07:59 -0500)
Applied, thanks.
-- PMM
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-05 22:05 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-06-05 19:41 [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Michael Roth
2014-06-05 19:41 ` [Qemu-devel] [PATCH] qga: Fix handle fd leak in acquire_privilege() Michael Roth
2014-06-05 22:04 ` [Qemu-devel] [PULL 0/1] qemu-ga fixes for win32 Peter Maydell
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).