From 67d568c288dae99ff29a150239c4a33bccf0d980 Mon Sep 17 00:00:00 2001 From: rwatson Date: Mon, 14 Oct 2002 19:55:49 +0000 Subject: 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(+) (limited to 'sys/ufs') diff --git a/sys/ufs/ufs/ufs_vnops.c b/sys/ufs/ufs/ufs_vnops.c index 70d3b1a..c0da28f 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 */ -- cgit v1.1