summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Kondel <tomasz.kondel2@sonymobile.com>2014-02-06 08:57:27 +0100
committerJP Abgrall <jpa@google.com>2014-11-13 18:20:55 +0000
commitbfdcc40bffa755b953b73a42cc72b802d0178afb (patch)
tree56a17b0bd0585df272d20682a8c8a07d5c02fd7c
parentca1797ae00d3b5bf2eb4d1cad5bb68cef0074346 (diff)
downloadsystem_core-bfdcc40bffa755b953b73a42cc72b802d0178afb.zip
system_core-bfdcc40bffa755b953b73a42cc72b802d0178afb.tar.gz
system_core-bfdcc40bffa755b953b73a42cc72b802d0178afb.tar.bz2
Close fd on error path in do_mount()
This fix closes a file descriptor before returning error from do_mount() Change-Id: Ib370229f16bf9ac385162d6b163cc5b079a1e73e
-rw-r--r--init/builtins.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/init/builtins.c b/init/builtins.c
index c192551..7f4daa7 100644
--- a/init/builtins.c
+++ b/init/builtins.c
@@ -433,6 +433,7 @@ int do_mount(int nargs, char **args)
sprintf(tmp, "/dev/block/loop%d", n);
loop = open(tmp, mode);
if (loop < 0) {
+ close(fd);
return -1;
}