summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-10-21 17:22:35 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:53:01 -0500
commit677c218f3f63565c5b3ca6b19db0aa900115c561 (patch)
treef3beb87a636a0a1949c5e5508fd1f2932abba07d
parent1e8cb5430807a5975af33d7305cb66e0d4819a01 (diff)
downloadsamba-677c218f3f63565c5b3ca6b19db0aa900115c561.tar.gz
samba-677c218f3f63565c5b3ca6b19db0aa900115c561.tar.bz2
samba-677c218f3f63565c5b3ca6b19db0aa900115c561.zip
r3117: Fix from Tom Lackemann <cessnatomny@yahoo.com> for bug #1954.
Memory leak in posix acl code. Jeremy. (This used to be commit c97aab7ee6bf1f385b445b4b0eb0e1df7e9a56f5)
-rw-r--r--source3/smbd/posix_acls.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/source3/smbd/posix_acls.c b/source3/smbd/posix_acls.c
index 95938b1e15..ab32d0591e 100644
--- a/source3/smbd/posix_acls.c
+++ b/source3/smbd/posix_acls.c
@@ -3195,6 +3195,7 @@ int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode
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 @@ int get_acl_group_bits( connection_struct *conn, const char *fname, mode_t *mode
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;
}