qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH for-3.0] qga: fix file descriptor leak
@ 2018-07-15 16:21 Paolo Bonzini
  2018-07-15 22:22 ` Philippe Mathieu-Daudé
  2018-07-16 21:37 ` Michael Roth
  0 siblings, 2 replies; 3+ messages in thread
From: Paolo Bonzini @ 2018-07-15 16:21 UTC (permalink / raw)
  To: qemu-devel; +Cc: Michael Roth

The file descriptor for /sys/power/state was never closed.  Reported
by Coverity.

Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
---
 qga/commands-posix.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/qga/commands-posix.c b/qga/commands-posix.c
index 233f78a406..4160aceaed 100644
--- a/qga/commands-posix.c
+++ b/qga/commands-posix.c
@@ -1651,6 +1651,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;
     }
-- 
2.17.1

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-16 21:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-15 16:21 [Qemu-devel] [PATCH for-3.0] qga: fix file descriptor leak Paolo Bonzini
2018-07-15 22:22 ` Philippe Mathieu-Daudé
2018-07-16 21:37 ` Michael Roth

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).