Close fd on error path in do_mount()
This fix closes a file descriptor before returning error from do_mount() Change-Id: Ib370229f16bf9ac385162d6b163cc5b079a1e73e
This commit is contained in:
parent
ca1797ae00
commit
bfdcc40bff
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue