diff options
author | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-13 21:05:34 +0000 |
---|---|---|
committer | Doug Hogan <doug@cvs.openbsd.org> | 2014-12-13 21:05:34 +0000 |
commit | 80be619ed8893c124ce97f593c5d53c819023c7e (patch) | |
tree | 77561bf790a4f667f18e5d99327b02c906f29183 /sys/kern/uipc_syscalls.c | |
parent | 2bef9f90fd3a945ab3c0b8e3685da6dad3ca246f (diff) |
yet more mallocarray() changes.
ok tedu@ deraadt@
Diffstat (limited to 'sys/kern/uipc_syscalls.c')
-rw-r--r-- | sys/kern/uipc_syscalls.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c index 03824de6000..2d382e3e4a1 100644 --- a/sys/kern/uipc_syscalls.c +++ b/sys/kern/uipc_syscalls.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_syscalls.c,v 1.96 2014/12/11 19:21:57 tedu Exp $ */ +/* $OpenBSD: uipc_syscalls.c,v 1.97 2014/12/13 21:05:33 doug Exp $ */ /* $NetBSD: uipc_syscalls.c,v 1.19 1996/02/09 19:00:48 christos Exp $ */ /* @@ -562,9 +562,10 @@ sendit(struct proc *p, int s, struct msghdr *mp, int flags, register_t *retsize) control = 0; #ifdef KTRACE if (KTRPOINT(p, KTR_GENIO)) { + ktriov = mallocarray(auio.uio_iovcnt, sizeof(struct iovec), + M_TEMP, M_WAITOK); iovlen = auio.uio_iovcnt * sizeof (struct iovec); - ktriov = malloc(iovlen, M_TEMP, M_WAITOK); memcpy(ktriov, auio.uio_iov, iovlen); } #endif @@ -706,9 +707,10 @@ recvit(struct proc *p, int s, struct msghdr *mp, caddr_t namelenp, } #ifdef KTRACE if (KTRPOINT(p, KTR_GENIO)) { + ktriov = mallocarray(auio.uio_iovcnt, sizeof(struct iovec), + M_TEMP, M_WAITOK); iovlen = auio.uio_iovcnt * sizeof (struct iovec); - ktriov = malloc(iovlen, M_TEMP, M_WAITOK); memcpy(ktriov, auio.uio_iov, iovlen); } #endif |