]> Git Repo - qemu.git/commitdiff
qga: fix file descriptor leak
authorPaolo Bonzini <[email protected]>
Sun, 15 Jul 2018 16:21:56 +0000 (18:21 +0200)
committerMichael Roth <[email protected]>
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 <[email protected]>
Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
Signed-off-by: Michael Roth <[email protected]>
qga/commands-posix.c

index c46767b0dd117cd21e55f65e1fd955d11493ed63..37e8a2d7918657f3d261fd5e1b0e9e966796069e 100644 (file)
@@ -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;
     }
This page took 0.028596 seconds and 4 git commands to generate.