Date: Fri, 18 Oct 2002 14:01:21 -0700 (PDT) From: Robert Watson <rwatson@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 19580 for review Message-ID: <200210182101.g9IL1LDF083193@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=19580 Change 19580 by rwatson@rwatson_tislabs on 2002/10/18 14:00:20 Merge two semantically similar but syntactically different ACL memory leak fixes. Affected files ... .. //depot/projects/trustedbsd/mac/sys/ufs/ufs/ufs_vnops.c#54 edit Differences ... ==== //depot/projects/trustedbsd/mac/sys/ufs/ufs/ufs_vnops.c#54 (text+ko) ==== @@ -1356,7 +1356,7 @@ struct dirtemplate dirtemplate, *dtp; struct direct newdir; #ifdef UFS_ACL - struct acl *acl = NULL, *dacl = NULL; + struct acl *acl, *dacl; #endif int error, dmode; long blkoff; @@ -1559,11 +1559,12 @@ break; default: + FREE(acl, M_ACL); + FREE(dacl, M_ACL); goto bad; } FREE(acl, M_ACL); FREE(dacl, M_ACL); - acl = dacl = NULL; } #endif /* !UFS_ACL */ @@ -1647,12 +1648,6 @@ vput(tvp); } out: -#ifdef UFS_ACL - if (acl != NULL) - FREE(acl, M_ACL); - if (dacl != NULL) - FREE(dacl, M_ACL); -#endif /* UFS_ACL */ return (error); } @@ -2289,7 +2284,7 @@ struct direct newdir; struct vnode *tvp; #ifdef UFS_ACL - struct acl *acl = NULL; + struct acl *acl; #endif int error; @@ -2475,10 +2470,10 @@ break; default: + FREE(acl, M_ACL); goto bad; } FREE(acl, M_ACL); - acl = NULL; } #endif /* !UFS_ACL */ ufs_makedirentry(ip, cnp, &newdir); @@ -2500,10 +2495,6 @@ if (DOINGSOFTDEP(tvp)) softdep_change_linkcnt(ip); vput(tvp); -#ifdef UFS_ACL - if (acl != NULL) - FREE(acl, M_ACL); -#endif /* UFS_ACL */ return (error); } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210182101.g9IL1LDF083193>