summaryrefslogtreecommitdiffstats
path: root/source3/modules
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2007-04-30 03:41:40 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 12:19:49 -0500
commit09ba519eb4a2c240ca7bd6ab830e632fdc4b8c5d (patch)
tree1ce47e24a63fefb1f3550017f0337c18b9a3ee5e /source3/modules
parent5b3d90e48b8f599cb0f4458839c26d33a9cbd7b3 (diff)
downloadsamba-09ba519eb4a2c240ca7bd6ab830e632fdc4b8c5d.tar.gz
samba-09ba519eb4a2c240ca7bd6ab830e632fdc4b8c5d.tar.xz
samba-09ba519eb4a2c240ca7bd6ab830e632fdc4b8c5d.zip
r22592: Fix TALLOC_SIZE to be consistent.
Jeremy. (This used to be commit 8044a6482c7c165a64878982cee5ee9756a0a734)
Diffstat (limited to 'source3/modules')
-rw-r--r--source3/modules/nfs4_acls.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/source3/modules/nfs4_acls.c b/source3/modules/nfs4_acls.c
index b6bcc8cd47f..8530a5db032 100644
--- a/source3/modules/nfs4_acls.c
+++ b/source3/modules/nfs4_acls.c
@@ -206,14 +206,18 @@ static BOOL smbacl4_nfs42win(SMB4ACL_T *acl, /* in */
if (aclint==NULL)
return False;
- nt_ace_list = (SEC_ACE *)TALLOC_SIZE(mem_ctx, aclint->naces * sizeof(SEC_ACE));
- if (nt_ace_list==NULL)
- {
- DEBUG(10, ("talloc error"));
- errno = ENOMEM;
- return False;
+ if (aclint->naces) {
+ nt_ace_list = (SEC_ACE *)TALLOC_SIZE(mem_ctx, aclint->naces * sizeof(SEC_ACE));
+ if (nt_ace_list==NULL)
+ {
+ DEBUG(10, ("talloc error"));
+ errno = ENOMEM;
+ return False;
+ }
+ memset(nt_ace_list, 0, aclint->naces * sizeof(SEC_ACE));
+ } else {
+ nt_ace_list = NULL;
}
- memset(nt_ace_list, 0, aclint->naces * sizeof(SEC_ACE));
for (aceint=aclint->first; aceint!=NULL; aceint=(SMB_ACE4_INT_T *)aceint->next) {
SEC_ACCESS mask;