From baeb8a4774f3fc17f53e681b8f8cb090f3c57d57 Mon Sep 17 00:00:00 2001 From: Robert Watson Date: Mon, 14 Oct 2002 19:55:49 +0000 Subject: [PATCH] Fix two memory leaks in error conditions involving the UFS ACL code: if failures occur, make sure that we release both the default ACL and access ACL storage during new object creation. Spotted by: phk and his pet flexelint Sponsored by: DARPA, Network Associates Laboratories --- sys/ufs/ufs/ufs_vnops.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70d3b1a3bbd8..c0da28f22a9e 100644 --- a/sys/ufs/ufs/ufs_vnops.c +++ b/sys/ufs/ufs/ufs_vnops.c @@ -1480,6 +1480,8 @@ ufs_mkdir(ap) default: UFS_VFREE(tvp, ip->i_number, dmode); vput(tvp); + FREE(acl, M_ACL); + FREE(dacl, M_ACL); return (error); } #else /* !UFS_ACL */ @@ -2381,6 +2383,8 @@ ufs_makeinode(mode, dvp, vpp, cnp) default: UFS_VFREE(tvp, ip->i_number, mode); vput(tvp); + FREE(acl, M_ACL); + acl = NULL; return (error); } #else /* !UFS_ACL */