summaryrefslogtreecommitdiffstats
path: root/qga
diff options
context:
space:
mode:
authorPaolo Bonzini2018-07-15 18:21:56 +0200
committerMichael Roth2018-07-16 22:05:58 +0200
commitd9c745c1768727aadd77e352c85114bc61e67bd4 (patch)
tree508ff8b7414b32864b968058ea60a1748962da5b /qga
parentqga: fix 'driver' leak in guest-get-fsinfo (diff)
downloadqemu-d9c745c1768727aadd77e352c85114bc61e67bd4.tar.gz
qemu-d9c745c1768727aadd77e352c85114bc61e67bd4.tar.xz
qemu-d9c745c1768727aadd77e352c85114bc61e67bd4.zip
qga: fix file descriptor leak
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>
Diffstat (limited to 'qga')
-rw-r--r--qga/commands-posix.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index c46767b0dd..37e8a2d791 100644
--- 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;
}