diff options
| author | zhanghailiang | 2014-08-22 10:23:51 +0200 |
|---|---|---|
| committer | Michael Tokarev | 2014-08-24 11:18:28 +0200 |
| commit | 680dfde91981516942ec557ef1c27753db24cbe8 (patch) | |
| tree | 49a6bfa6bfae42db9d629fc5f500a114f566b7c4 /linux-user | |
| parent | po: Fix Makefile rules for in-tree builds without configuration (diff) | |
| download | qemu-680dfde91981516942ec557ef1c27753db24cbe8.tar.gz qemu-680dfde91981516942ec557ef1c27753db24cbe8.tar.xz qemu-680dfde91981516942ec557ef1c27753db24cbe8.zip | |
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>
Reviewed-by: Gonglei <arei.gonglei@huawei.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
Diffstat (limited to 'linux-user')
| -rw-r--r-- | linux-user/syscall.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 7ff7c21255..8fe9df7b87 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; } } |
