mirror of
https://github.com/apache/nuttx.git
synced 2026-06-04 14:53:47 +08:00
binfmt/builtin.c: Fix a memory leak: File was not being closed.
This commit is contained in:
committed by
Gregory Nutt
parent
ed750f3600
commit
3fd07e32e9
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user