summaryrefslogtreecommitdiffstats
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r--sys/kern/link_elf.c27
1 files changed, 9 insertions, 18 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c
index bf2dfd0..1579c28 100644
--- a/sys/kern/link_elf.c
+++ b/sys/kern/link_elf.c
@@ -1090,12 +1090,9 @@ out:
vn_close(nd.ni_vp, FREAD, td->td_ucred, td);
if (error != 0 && lf != NULL)
linker_file_unload(lf, LINKER_UNLOAD_FORCE);
- if (shdr != NULL)
- free(shdr, M_LINKER);
- if (firstpage != NULL)
- free(firstpage, M_LINKER);
- if (shstrs != NULL)
- free(shstrs, M_LINKER);
+ free(shdr, M_LINKER);
+ free(firstpage, M_LINKER);
+ free(shstrs, M_LINKER);
return (error);
}
@@ -1157,19 +1154,13 @@ link_elf_unload_file(linker_file_t file)
+ (ef->object->size << PAGE_SHIFT));
}
#else
- if (ef->address != NULL)
- free(ef->address, M_LINKER);
+ free(ef->address, M_LINKER);
#endif
- if (ef->symbase != NULL)
- free(ef->symbase, M_LINKER);
- if (ef->strbase != NULL)
- free(ef->strbase, M_LINKER);
- if (ef->ctftab != NULL)
- free(ef->ctftab, M_LINKER);
- if (ef->ctfoff != NULL)
- free(ef->ctfoff, M_LINKER);
- if (ef->typoff != NULL)
- free(ef->typoff, M_LINKER);
+ free(ef->symbase, M_LINKER);
+ free(ef->strbase, M_LINKER);
+ free(ef->ctftab, M_LINKER);
+ free(ef->ctfoff, M_LINKER);
+ free(ef->typoff, M_LINKER);
}
static void
OpenPOWER on IntegriCloud