svn commit: samba r3116 - in trunk/source/smbd: .
jra at samba.org
jra at samba.org
Thu Oct 21 17:22:16 GMT 2004
Author: jra
Date: 2004-10-21 17:22:15 +0000 (Thu, 21 Oct 2004)
New Revision: 3116
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/trunk/source/smbd&rev=3116&nolog=1
Log:
Fix from Tom Lackemann <cessnatomny at yahoo.com> for bug #1954.
Memory leak in posix acl code.
Jeremy.
Modified:
trunk/source/smbd/posix_acls.c
Changeset:
Modified: trunk/source/smbd/posix_acls.c
===================================================================
--- trunk/source/smbd/posix_acls.c 2004-10-21 15:24:50 UTC (rev 3115)
+++ trunk/source/smbd/posix_acls.c 2004-10-21 17:22:15 UTC (rev 3116)
@@ -3195,6 +3195,7 @@
int entry_id = SMB_ACL_FIRST_ENTRY;
SMB_ACL_ENTRY_T entry;
SMB_ACL_T posix_acl;
+ int result = -1;
posix_acl = SMB_VFS_SYS_ACL_GET_FILE(conn, fname, SMB_ACL_TYPE_ACCESS);
if (posix_acl == (SMB_ACL_T)NULL)
@@ -3209,20 +3210,22 @@
entry_id = SMB_ACL_NEXT_ENTRY;
if (SMB_VFS_SYS_ACL_GET_TAG_TYPE(conn, entry, &tagtype) ==-1)
- return -1;
+ break;
if (tagtype == SMB_ACL_GROUP_OBJ) {
if (SMB_VFS_SYS_ACL_GET_PERMSET(conn, entry, &permset) == -1) {
- return -1;
+ break;
} else {
*mode &= ~(S_IRGRP|S_IWGRP|S_IXGRP);
*mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_READ) ? S_IRGRP : 0);
*mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_WRITE) ? S_IWGRP : 0);
*mode |= (SMB_VFS_SYS_ACL_GET_PERM(conn, permset, SMB_ACL_EXECUTE) ? S_IXGRP : 0);
- return 0;;
+ result = 0;
+ break;
}
}
}
+ SMB_VFS_SYS_ACL_FREE_ACL(conn, posix_acl);
return -1;
}
More information about the samba-cvs
mailing list