mirror of
https://github.com/apache/nuttx.git
synced 2026-09-22 06:04:28 +08:00
binnfmt:Fix return before close ELF fd
elf_init open a elf file , if both enabled CONFIG_NSH_BUIlTAPPS and CONFIG_NSH_FILE_APPS , elf_init will read elf file in /bin directory, but that length is zero , elf_read failed return and NOT close elf fd, so this line MUST be return to errout_with_init
This commit is contained in:
+1
-2
@@ -220,7 +220,7 @@ static int elf_loadbinary(FAR struct binary_s *binp)
|
||||
if (ret != 0)
|
||||
{
|
||||
berr("Failed to initialize for load of ELF program: %d\n", ret);
|
||||
goto errout;
|
||||
goto errout_with_init;
|
||||
}
|
||||
|
||||
/* Load the program binary */
|
||||
@@ -287,7 +287,6 @@ errout_with_load:
|
||||
elf_unload(&loadinfo);
|
||||
errout_with_init:
|
||||
elf_uninit(&loadinfo);
|
||||
errout:
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user