posix_acls: Use talloc_zero_array
authorVolker Lendecke <vl@samba.org>
Thu, 9 Feb 2017 17:46:06 +0000 (18:46 +0100)
committerJeremy Allison <jra@samba.org>
Wed, 1 Mar 2017 19:33:18 +0000 (20:33 +0100)
This is a slight change in behaviour: We now also zero out
the space for num_profile_acls.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/smbd/posix_acls.c

index ae667ef9dc080663e15906242f9759c4c13e2d7d..72bb9fe086ee91e5c5cb7b51f195908d486f9bbc 100644 (file)
@@ -3359,7 +3359,7 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
                        num_acls = count_canon_ace_list(file_ace);
                        num_def_acls = count_canon_ace_list(dir_ace);
 
-                       nt_ace_list = talloc_array(
+                       nt_ace_list = talloc_zero_array(
                                talloc_tos(), struct security_ace,
                                num_acls + num_profile_acls + num_def_acls);
 
@@ -3368,8 +3368,6 @@ static NTSTATUS posix_get_nt_acl_common(struct connection_struct *conn,
                                goto done;
                        }
 
-                       memset(nt_ace_list, '\0', (num_acls + num_def_acls) * sizeof(struct security_ace) );
-
                        /*
                         * Create the NT ACE list from the canonical ace lists.
                         */