summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorPedro Martelletto <pedro@cvs.openbsd.org>2007-04-02 10:57:18 +0000
committerPedro Martelletto <pedro@cvs.openbsd.org>2007-04-02 10:57:18 +0000
commit2611f8963a4c050f38e296f83f27147811a96cff (patch)
tree18a59957608876f3de2cc5a5c412c95ff4b8d8dc /sys
parentc86ec29ed1ef760f6d2094236ebcf88fa1b8a289 (diff)
vrele() the destination directory vnode in ufs_rename() if the call to
ufs_checkpath() fails, okay krw@ tom@ thib@ deraadt@
Diffstat (limited to 'sys')
-rw-r--r--sys/ufs/ufs/ufs_vnops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c
index 04c3fbfb17c..18de827db84 100644
--- a/sys/ufs/ufs/ufs_vnops.c
+++ b/sys/ufs/ufs/ufs_vnops.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ufs_vnops.c,v 1.74 2007/03/21 17:29:32 thib Exp $ */
+/* $OpenBSD: ufs_vnops.c,v 1.75 2007/04/02 10:57:17 pedro Exp $ */
/* $NetBSD: ufs_vnops.c,v 1.18 1996/05/11 18:28:04 mycroft Exp $ */
/*
@@ -936,8 +936,10 @@ abortit:
*/
vref(tdvp);
/* Only tdvp is locked */
- if ((error = ufs_checkpath(ip, dp, tcnp->cn_cred)) != 0)
+ if ((error = ufs_checkpath(ip, dp, tcnp->cn_cred)) != 0) {
+ vrele(tdvp);
goto out;
+ }
if ((tcnp->cn_flags & SAVESTART) == 0)
panic("ufs_rename: lost to startdir");
if ((error = relookup(tdvp, &tvp, tcnp)) != 0)