qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH for-3.0] qga: fix file descriptor leak


From: Philippe Mathieu-Daudé
Subject: Re: [Qemu-devel] [PATCH for-3.0] qga: fix file descriptor leak
Date: Sun, 15 Jul 2018 19:22:59 -0300
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1

On 07/15/2018 01:21 PM, Paolo Bonzini wrote:
> The file descriptor for /sys/power/state was never closed.  Reported
> by Coverity.
> 
> Signed-off-by: Paolo Bonzini <address@hidden>

Reviewed-by: Philippe Mathieu-Daudé <address@hidden>

> ---
>  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;
>      }
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]