aboutsummaryrefslogtreecommitdiff
path: root/sys/kern/link_elf.c
diff options
context:
space:
mode:
authorKonstantin Belousov <kib@FreeBSD.org>2016-02-10 21:35:00 +0000
committerKonstantin Belousov <kib@FreeBSD.org>2016-02-10 21:35:00 +0000
commit0be1e0e879733b5970fcf20d3b24533b3a22c401 (patch)
treed2e47aed1f09b58add939cd627cdf8c5a5dbf8ef /sys/kern/link_elf.c
parent86a448c3a4bd5d826a6d91d06ef4143c0a8dd207 (diff)
downloadsrc-0be1e0e879733b5970fcf20d3b24533b3a22c401.tar.gz
src-0be1e0e879733b5970fcf20d3b24533b3a22c401.zip
Notes
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 bf2dfd00a375..1579c28dd3b1 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