qemu-trivial
[Top][All Lists]
Advanced

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

[Qemu-trivial] [PULL 09/11] linux-user: fix file descriptor leaks


From: Michael Tokarev
Subject: [Qemu-trivial] [PULL 09/11] linux-user: fix file descriptor leaks
Date: Sun, 24 Aug 2014 17:31:00 +0400

From: zhanghailiang <address@hidden>

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

Signed-off-by: zhanghailiang <address@hidden>
Reviewed-by: Gonglei <address@hidden>
Signed-off-by: Michael Tokarev <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 7ff7c21..8fe9df7 100644
--- a/linux-user/syscall.c
+++ b/linux-user/syscall.c
@@ -5167,6 +5167,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.10.4




reply via email to

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