mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 08:36:24 +08:00
Merged in masayuki2009/nuttx.nuttx/bug_fix_by_sony (pull request #374)
binfmt: Fix .dtor memory allocation Approved-by: Gregory Nutt <gnutt@nuttx.org>
This commit is contained in:
@@ -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 */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user