OSDN Git Service
(root)
/
qmiga
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bb23a73
)
qga: fix file descriptor leak
author
Paolo Bonzini
<pbonzini@redhat.com>
Sun, 15 Jul 2018 16:21:56 +0000
(18:21 +0200)
committer
Michael Roth
<mdroth@linux.vnet.ibm.com>
Mon, 16 Jul 2018 20:05:58 +0000
(15:05 -0500)
The file descriptor for /sys/power/state was never closed. Reported
by Coverity.
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
qga/commands-posix.c
patch
|
blob
|
history
diff --git
a/qga/commands-posix.c
b/qga/commands-posix.c
index
c46767b
..
37e8a2d
100644
(file)
--- a/
qga/commands-posix.c
+++ b/
qga/commands-posix.c
@@
-1652,6
+1652,7
@@
static bool linux_sys_state_supports_mode(SuspendMode mode, Error **errp)
}
ret = read(fd, buf, sizeof(buf) - 1);
+ close(fd);
if (ret <= 0) {
return false;
}