binfmt/builtin.c: Fix a memory leak: File was not being closed.
This commit is contained in:
parent
ed750f3600
commit
3fd07e32e9
|
@ -10903,3 +10903,6 @@
|
|||
* include/nuttx/mtd/mtd.h: Move MTD ioctl command definitions from
|
||||
include/nuttx/fs/fs.h to include/nuttx/mtd.h. Add ioctl commands
|
||||
to protect and unprotect memory (2015-08-29).
|
||||
* binfmt/builtin.c: Fix a memory leak: File was not being closed.
|
||||
From Bruno Herrera (2015-08-30).
|
||||
|
||||
|
|
|
@ -116,6 +116,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
{
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: FIOC_FILENAME ioctl failed: %d\n", errval);
|
||||
close(fd);
|
||||
return -errval;
|
||||
}
|
||||
|
||||
|
@ -128,6 +129,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
{
|
||||
int errval = get_errno();
|
||||
bdbg("ERROR: %s is not a builtin application\n", filename);
|
||||
close(fd);
|
||||
return -errval;
|
||||
|
||||
}
|
||||
|
@ -140,6 +142,7 @@ static int builtin_loadbinary(struct binary_s *binp)
|
|||
binp->entrypt = b->main;
|
||||
binp->stacksize = b->stacksize;
|
||||
binp->priority = b->priority;
|
||||
close(fd);
|
||||
return OK;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue