提交 d9c745c1 编写于 作者: P Paolo Bonzini 提交者: Michael Roth

qga: fix file descriptor leak

The file descriptor for /sys/power/state was never closed.  Reported
by Coverity.
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Reviewed-by: NPhilippe Mathieu-Daudé <f4bug@amsat.org>
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 bb23a736
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册