diff options
Diffstat (limited to 'sys/kern/link_elf.c')
-rw-r--r-- | sys/kern/link_elf.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/sys/kern/link_elf.c b/sys/kern/link_elf.c index c2cceff..0293299 100644 --- a/sys/kern/link_elf.c +++ b/sys/kern/link_elf.c @@ -1027,10 +1027,8 @@ 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); + free(shdr, M_LINKER); + free(firstpage, M_LINKER); return (error); } @@ -1092,19 +1090,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 |