summaryrefslogtreecommitdiffstats
path: root/sys/kern
diff options
context:
space:
mode:
authorpjd <pjd@FreeBSD.org>2010-12-14 06:19:13 +0000
committerpjd <pjd@FreeBSD.org>2010-12-14 06:19:13 +0000
commit627e6dcc72d4eed44917dcd2cf06e9ae435876d3 (patch)
treec5066c64dba1df9183ec939dac19e8faf76fb160 /sys/kern
parentc879c327e5fddce7e317c769a938ba4163fc3b40 (diff)
downloadFreeBSD-src-627e6dcc72d4eed44917dcd2cf06e9ae435876d3.zip
FreeBSD-src-627e6dcc72d4eed44917dcd2cf06e9ae435876d3.tar.gz
Just pass M_ZERO to malloc(9) instead of clearing allocated memory separately.
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_syscalls.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index 06869b2..459082b 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -1888,8 +1888,7 @@ kern_sendfile(struct thread *td, struct sendfile_args *uap,
mnw = 1;
if (uap->flags & SF_SYNC) {
- sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK);
- memset(sfs, 0, sizeof *sfs);
+ sfs = malloc(sizeof *sfs, M_TEMP, M_WAITOK | M_ZERO);
mtx_init(&sfs->mtx, "sendfile", NULL, MTX_DEF);
cv_init(&sfs->cv, "sendfile");
}
OpenPOWER on IntegriCloud