[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks
From: |
Gonglei (Arei) |
Subject: |
Re: [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks |
Date: |
Fri, 22 Aug 2014 08:43:18 +0000 |
> -----Original Message-----
> From: address@hidden
> [mailto:address@hidden On
> Behalf Of zhanghailiang
> Sent: Friday, August 22, 2014 4:24 PM
> To: address@hidden
> Cc: address@hidden; address@hidden; Luonengjun; Huangpeng
> (Peter); Zhanghailiang
> Subject: [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks
>
> Handle variable "fd_orig" going out of scope leaks the handle.
>
> Signed-off-by: zhanghailiang <address@hidden>
> ---
> linux-user/syscall.c | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/linux-user/syscall.c b/linux-user/syscall.c
> index a50229d..11a48c2 100644
> --- a/linux-user/syscall.c
> +++ b/linux-user/syscall.c
> @@ -5082,6 +5082,7 @@ static int open_self_cmdline(void *cpu_env, int fd)
>
> if (word_skipped) {
> if (write(fd, cp_buf, nb_read) != nb_read) {
> + close(fd_orig);
> return -1;
> }
> }
> --
> 1.7.12.4
>
>
Reviewed-by: Gonglei <address@hidden>
Best regards,
-Gonglei