projects
/
qemu.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
bcc55f3
)
linux-user: fix file descriptor leaks
author
zhanghailiang
<zhang.zhanghailiang@huawei.com>
Fri, 22 Aug 2014 08:23:51 +0000
(16:23 +0800)
committer
Michael Tokarev
<mjt@tls.msk.ru>
Sun, 24 Aug 2014 09:18:28 +0000
(13:18 +0400)
Handle variable "fd_orig" going out of scope leaks the handle.
Signed-off-by: zhanghailiang <zhang.zhanghailiang@huawei.com>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
linux-user/syscall.c
patch
|
blob
|
history
diff --git
a/linux-user/syscall.c
b/linux-user/syscall.c
index 7ff7c2125536bc0087ccf427942527847bc1ad92..8fe9df7b87571b5c102ff24d43eea1e4596e388a 100644
(file)
--- 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;
}
}