From: zhanghailiang Date: Fri, 22 Aug 2014 08:23:51 +0000 (+0800) Subject: linux-user: fix file descriptor leaks X-Git-Tag: Tizen_Studio_1.3_Release_p2.3.2~209^2~642^2~2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=680dfde91981516942ec557ef1c27753db24cbe8;p=sdk%2Femulator%2Fqemu.git linux-user: fix file descriptor leaks Handle variable "fd_orig" going out of scope leaks the handle. Signed-off-by: zhanghailiang Reviewed-by: Gonglei Signed-off-by: Michael Tokarev --- 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; } }