binfmt: Fix .dtor memory allocation
Jira: PDFW15IS-265 Coverity-ID: 11053 Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
This commit is contained in:
parent
3633b5b6d5
commit
b1008477ac
@ -163,14 +163,14 @@ int elf_loaddtors(FAR struct elf_loadinfo_s *loadinfo)
|
||||
{
|
||||
/* Allocate memory to hold a copy of the .dtor section */
|
||||
|
||||
loadinfo->ctoralloc = (binfmt_dtor_t *)kumm_malloc(dtorsize);
|
||||
if (!loadinfo->ctoralloc)
|
||||
loadinfo->dtoralloc = (binfmt_dtor_t *)kumm_malloc(dtorsize);
|
||||
if (!loadinfo->dtoralloc)
|
||||
{
|
||||
berr("Failed to allocate memory for .dtors\n");
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
loadinfo->dtors = (binfmt_dtor_t *)loadinfo->ctoralloc;
|
||||
loadinfo->dtors = (binfmt_dtor_t *)loadinfo->dtoralloc;
|
||||
|
||||
/* Read the section header table into memory */
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user