From 126158251a6a5564192b31f85402e335765cf8de Mon Sep 17 00:00:00 2001 From: tmm Date: Thu, 7 Jun 2001 00:11:32 +0000 Subject: Call vn_close on the backing file vnode if ufs_extattr_enable failed to avoid leaking it. Reviewed by: rwatson --- sys/ufs/ufs/ufs_extattr.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/ufs') 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 -- cgit v1.1