From 5c0d21284ecf3adc579619a2f4fa5a7a1feafa68 Mon Sep 17 00:00:00 2001 From: Aaron Campbell Date: Mon, 12 Aug 2002 14:32:45 +0000 Subject: Missing FRELE() call on writev(2) error condition; art@ ok. --- sys/kern/sys_generic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/kern') 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; -- cgit v1.2.3