From bfdcc40bffa755b953b73a42cc72b802d0178afb Mon Sep 17 00:00:00 2001 From: Tomasz Kondel Date: Thu, 6 Feb 2014 08:57:27 +0100 Subject: Close fd on error path in do_mount() This fix closes a file descriptor before returning error from do_mount() Change-Id: Ib370229f16bf9ac385162d6b163cc5b079a1e73e --- init/builtins.c | 1 + 1 file changed, 1 insertion(+) (limited to 'init') 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; } -- cgit v1.1