diff options
author | tmm <tmm@FreeBSD.org> | 2001-06-07 00:11:32 +0000 |
---|---|---|
committer | tmm <tmm@FreeBSD.org> | 2001-06-07 00:11:32 +0000 |
commit | 126158251a6a5564192b31f85402e335765cf8de (patch) | |
tree | fb0293f19a9a315e341996e4b58b3ad614073c75 /sys/ufs | |
parent | c1faa4bcfff27ff7d1a9775c859bbe2ab8721f83 (diff) | |
download | FreeBSD-src-126158251a6a5564192b31f85402e335765cf8de.zip FreeBSD-src-126158251a6a5564192b31f85402e335765cf8de.tar.gz |
Call vn_close on the backing file vnode if ufs_extattr_enable failed to
avoid leaking it.
Reviewed by: rwatson
Diffstat (limited to 'sys/ufs')
-rw-r--r-- | sys/ufs/ufs/ufs_extattr.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/ufs/ufs/ufs_extattr.c b/sys/ufs/ufs/ufs_extattr.c index a43baea..b713267 100644 --- a/sys/ufs/ufs/ufs_extattr.c +++ b/sys/ufs/ufs/ufs_extattr.c @@ -345,7 +345,10 @@ ufs_extattr_enable_with_open(struct ufsmount *ump, struct vnode *vp, VOP_UNLOCK(vp, 0, p); - return (ufs_extattr_enable(ump, attrnamespace, attrname, vp, p)); + error = ufs_extattr_enable(ump, attrnamespace, attrname, vp, p); + if (error != 0) + vn_close(vp, FREAD|FWRITE, p->p_ucred, p); + return (error); } #ifdef UFS_EXTATTR_AUTOSTART |