summaryrefslogtreecommitdiff
path: root/sys/kern/link_elf_obj.c
diff options
context:
space:
mode:
authorDavid Malone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
committerDavid Malone <dwmalone@FreeBSD.org>2000-12-08 21:51:06 +0000
commit7cc0979fd64b721c92c3dd4a8688b56e15c9a5f9 (patch)
treec383ffd6da8fbab2789828310191f8717f675124 /sys/kern/link_elf_obj.c
parentb1f3daafde37fa36b819c0649c121d98175a6a2d (diff)
Notes
Diffstat (limited to 'sys/kern/link_elf_obj.c')
-rw-r--r--sys/kern/link_elf_obj.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/link_elf_obj.c b/sys/kern/link_elf_obj.c
index f812bfd9136a..9908d8a5e4f8 100644
--- a/sys/kern/link_elf_obj.c
+++ b/sys/kern/link_elf_obj.c
@@ -728,12 +728,11 @@ link_elf_load_file(linker_class_t cls, const char* filename, linker_file_t* resu
nbytes = hdr->e_shnum * hdr->e_shentsize;
if (nbytes == 0 || hdr->e_shoff == 0)
goto nosyms;
- shdr = malloc(nbytes, M_LINKER, M_WAITOK);
+ shdr = malloc(nbytes, M_LINKER, M_WAITOK | M_ZERO);
if (shdr == NULL) {
error = ENOMEM;
goto out;
}
- bzero(shdr, nbytes);
error = vn_rdwr(UIO_READ, nd.ni_vp,
(caddr_t)shdr, nbytes, hdr->e_shoff,
UIO_SYSSPACE, IO_NODELOCKED, p->p_ucred, &resid, p);