]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
r22592: Fix TALLOC_SIZE to be consistent.
authorJeremy Allison <jra@samba.org>
Mon, 30 Apr 2007 03:41:40 +0000 (03:41 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 17:19:49 +0000 (12:19 -0500)
Jeremy.

source/modules/nfs4_acls.c

index b6bcc8cd47fb99ac15d152365b2a4d50cd67b0ba..8530a5db032bbf097cc328a98316740837755045 100644 (file)
@@ -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;