summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authoraaron <aaron@openbsd.org>2002-08-12 14:32:44 +0000
committeraaron <aaron@openbsd.org>2002-08-12 14:32:44 +0000
commit85714ee821c7f27d881a383d70d20df8b35b02fc (patch)
tree57d57d21f0d3a4fc8848bcf48fd96da5d5e9539e /sys
parentSync hardware list with the current state of the code. (diff)
downloadwireguard-openbsd-85714ee821c7f27d881a383d70d20df8b35b02fc.tar.xz
wireguard-openbsd-85714ee821c7f27d881a383d70d20df8b35b02fc.zip
Missing FRELE() call on writev(2) error condition; art@ ok.
Diffstat (limited to 'sys')
-rw-r--r--sys/kern/sys_generic.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index 9c679c23bfc..b5b19ab0b23 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sys_generic.c,v 1.40 2002/08/11 02:20:24 provos Exp $ */
+/* $OpenBSD: sys_generic.c,v 1.41 2002/08/12 14:32:44 aaron Exp $ */
/* $NetBSD: sys_generic.c,v 1.24 1996/03/29 00:25:32 cgd Exp $ */
/*
@@ -427,8 +427,10 @@ dofilewritev(p, fd, fp, iovp, iovcnt, offset, retval)
/* note: can't use iovlen until iovcnt is validated */
iovlen = iovcnt * sizeof(struct iovec);
if ((u_int)iovcnt > UIO_SMALLIOV) {
- if ((u_int)iovcnt > IOV_MAX)
- return (EINVAL);
+ if ((u_int)iovcnt > IOV_MAX) {
+ error = EINVAL;
+ goto out;
+ }
iov = needfree = malloc(iovlen, M_IOV, M_WAITOK);
} else if ((u_int)iovcnt > 0) {
iov = aiov;