summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Latifi <pat@cvs.openbsd.org>2004-12-07 03:42:46 +0000
committerPatrick Latifi <pat@cvs.openbsd.org>2004-12-07 03:42:46 +0000
commit3a457a1fd63cee639bebe505f35920cc472ff35f (patch)
tree05f4619f1b9e7c16aed29b8152dd92ca8cb7887c
parentd8e3ebeaba99402c830eeb721475fb39e0f0364f (diff)
* add a missing vput() if VOP_SETATTR() fails.
ok tedu pedro millert
-rw-r--r--sys/kern/tty_pty.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/tty_pty.c b/sys/kern/tty_pty.c
index 08860465cc9..b55572b59c8 100644
--- a/sys/kern/tty_pty.c
+++ b/sys/kern/tty_pty.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tty_pty.c,v 1.25 2004/07/22 06:13:08 tedu Exp $ */
+/* $OpenBSD: tty_pty.c,v 1.26 2004/12/07 03:42:45 pat Exp $ */
/* $NetBSD: tty_pty.c,v 1.33.4.1 1996/06/02 09:08:11 mrg Exp $ */
/*
@@ -1196,8 +1196,10 @@ retry:
cred = crget();
error = VOP_SETATTR(snd.ni_vp, &vattr, cred, p);
crfree(cred);
- if (error)
+ if (error) {
+ vput(snd.ni_vp);
goto bad;
+ }
}
VOP_UNLOCK(snd.ni_vp, 0, p);
if (snd.ni_vp->v_usecount > 1 ||