summaryrefslogtreecommitdiff
path: root/nuttx/binfmt/libelf/libelf_unload.c
diff options
context:
space:
mode:
Diffstat (limited to 'nuttx/binfmt/libelf/libelf_unload.c')
-rw-r--r--nuttx/binfmt/libelf/libelf_unload.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/nuttx/binfmt/libelf/libelf_unload.c b/nuttx/binfmt/libelf/libelf_unload.c
index 9a198fc78..217a1981e 100644
--- a/nuttx/binfmt/libelf/libelf_unload.c
+++ b/nuttx/binfmt/libelf/libelf_unload.c
@@ -76,20 +76,19 @@
int elf_unload(struct elf_loadinfo_s *loadinfo)
{
- /* Reset the contents of the info structure. */
+ /* Release the all allocated memory */
- /* Release the memory segments */
-
- if (loadinfo->ispace)
+ if (loadinfo->alloc)
{
- kfree((void*)loadinfo->ispace, loadinfo->isize);
- loadinfo->ispace = 0;
+ kfree((void*)loadinfo->alloc);
+ loadinfo->alloc = NULL;
+ loadinfo->allocsize = 0;
}
- if (loadinfo->dspace)
+ if (loadinfo->shdrs)
{
- kfree((void*)loadinfo->dspace);
- loadinfo->dspace = 0;
+ kfree((void*)loadinfo->shdrs);
+ loadinfo->shdrs = 0;
}
return OK;