All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks
@ 2014-08-22  8:23 zhanghailiang
  2014-08-22  8:43 ` Gonglei (Arei)
  2014-08-24  9:18 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  0 siblings, 2 replies; 3+ messages in thread
From: zhanghailiang @ 2014-08-22  8:23 UTC (permalink / raw)
  To: qemu-devel
  Cc: qemu-trivial, riku.voipio, luonengjun, peter.huangpeng, zhanghailiang

Handle variable "fd_orig" going out of scope leaks the handle.

Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
---
 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

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

* Re: [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks
  2014-08-22  8:23 [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks zhanghailiang
@ 2014-08-22  8:43 ` Gonglei (Arei)
  2014-08-24  9:18 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Gonglei (Arei) @ 2014-08-22  8:43 UTC (permalink / raw)
  To: Zhanghailiang, qemu-devel
  Cc: qemu-trivial, riku.voipio, Luonengjun, Huangpeng (Peter)

> -----Original Message-----
> From: qemu-devel-bounces+arei.gonglei=huawei.com@nongnu.org
> [mailto:qemu-devel-bounces+arei.gonglei=huawei.com@nongnu.org] On
> Behalf Of zhanghailiang
> Sent: Friday, August 22, 2014 4:24 PM
> To: qemu-devel@nongnu.org
> Cc: qemu-trivial@nongnu.org; riku.voipio@iki.fi; 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 <zhang.zhanghailiang@huawei.com>
> ---
>  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 <arei.gonglei@huawei.com>

Best regards,
-Gonglei

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

* Re: [Qemu-devel] [Qemu-trivial] [PATCH] linux-user: fix file descriptor leaks
  2014-08-22  8:23 [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks zhanghailiang
  2014-08-22  8:43 ` Gonglei (Arei)
@ 2014-08-24  9:18 ` Michael Tokarev
  1 sibling, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2014-08-24  9:18 UTC (permalink / raw)
  To: zhanghailiang, qemu-devel
  Cc: qemu-trivial, riku.voipio, luonengjun, peter.huangpeng

Applied to -trivial, thank you!

/mjt

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

end of thread, other threads:[~2014-08-24  9:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-08-22  8:23 [Qemu-devel] [PATCH] linux-user: fix file descriptor leaks zhanghailiang
2014-08-22  8:43 ` Gonglei (Arei)
2014-08-24  9:18 ` [Qemu-devel] [Qemu-trivial] " Michael Tokarev

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.