s3-talloc Change TALLOC_ZERO_ARRAY() to talloc_zero_array()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 7 Jun 2011 01:58:39 +0000 (11:58 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 9 Jun 2011 10:40:08 +0000 (12:40 +0200)
Using the standard macro makes it easier to move code into common, as
TALLOC_ZERO_ARRAY isn't standard talloc.

40 files changed:
examples/VFS/shadow_copy_test.c
source3/client/client.c
source3/include/smb_macros.h
source3/lib/bitmap.c
source3/lib/netapi/cm.c
source3/lib/netapi/group.c
source3/lib/netapi/localgroup.c
source3/lib/netapi/user.c
source3/lib/util_sock.c
source3/libads/dns.c
source3/libads/ldap.c
source3/libnet/libnet_samsync_ldif.c
source3/libnet/libnet_samsync_passdb.c
source3/libsmb/clifile.c
source3/libsmb/clireadwrite.c
source3/libsmb/dsgetdcname.c
source3/libsmb/trusts_util.c
source3/modules/vfs_acl_common.c
source3/nmbd/nmbd_packets.c
source3/passdb/lookup_sid.c
source3/passdb/pdb_interface.c
source3/registry/reg_perfcount.c
source3/registry/regfio.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/rpc_server/samr/srv_samr_nt.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/rpcclient/cmd_drsuapi.c
source3/rpcclient/cmd_samr.c
source3/smbd/dir.c
source3/smbd/msdfs.c
source3/smbd/posix_acls.c
source3/utils/net_rpc.c
source3/utils/net_rpc_registry.c
source3/utils/sharesec.c
source3/winbindd/idmap_hash/idmap_hash.c
source3/winbindd/winbindd_ads.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_msrpc.c
source3/winbindd/winbindd_rpc.c
source3/winbindd/winbindd_sids_to_xids.c

index fab7007046f51373bd8d0aec399c7e6f637a5b25..d4da23846fca0fe5b5917315857fa2ce5db7c27b 100644 (file)
@@ -59,7 +59,7 @@ static int test_get_shadow_copy_data(vfs_handle_struct *handle, files_struct *fs
        
        if (labels) {   
                if (num) {
-                       shadow_copy_data->labels = TALLOC_ZERO_ARRAY(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num);
+                       shadow_copy_data->labels = talloc_zero_array(shadow_copy_data->mem_ctx,SHADOW_COPY_LABEL,num);
                } else {
                        shadow_copy_data->labels = NULL;
                }
index f088c7c8158a87cdde77eca53ae4c2dde6b21f4b..d25198bfb9b0436c83a98fc0000a01b910878da2 100644 (file)
@@ -1606,7 +1606,7 @@ static int cmd_altname(void)
 
 static char *attr_str(TALLOC_CTX *mem_ctx, uint16_t mode)
 {
-       char *attrs = TALLOC_ZERO_ARRAY(mem_ctx, char, 17);
+       char *attrs = talloc_zero_array(mem_ctx, char, 17);
        int i = 0;
 
        if (!(mode & FILE_ATTRIBUTE_NORMAL)) {
index 73472dd61f2f969b1383e4f61dac2207723da1d3..ce1bc6dafdfb093c4fbf6dbfc68727e6c8ac83ff 100644 (file)
@@ -221,7 +221,6 @@ copy an IP address from one buffer to another
 #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
 #define TALLOC_MEMDUP(ctx, ptr, size) _talloc_memdup(ctx, ptr, size, __location__)
 #define TALLOC_ZERO(ctx, size) _talloc_zero(ctx, size, __location__)
-#define TALLOC_ZERO_ARRAY(ctx, type, count) (type *)_talloc_zero_array(ctx, sizeof(type), count, #type)
 #define TALLOC_SIZE(ctx, size) talloc_named_const(ctx, size, __location__)
 #define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)
 
index 0acfcd8813a55e36201cef11122f697d08a58920..5216b05c58554a2013a527f1be059736169aeabf 100644 (file)
@@ -34,7 +34,7 @@ struct bitmap *bitmap_talloc(TALLOC_CTX *mem_ctx, int n)
        if (!bm) return NULL;
 
        bm->n = n;
-       bm->b = TALLOC_ZERO_ARRAY(bm, uint32, (n+31)/32);
+       bm->b = talloc_zero_array(bm, uint32, (n+31)/32);
        if (!bm->b) {
                TALLOC_FREE(bm);
                return NULL;
index 3adb97e3575569a9463b065815f9cd5a54c6aabc..47ccf8bb7a32fe137a636038eff08f1cb1b2ef50 100644 (file)
@@ -188,7 +188,7 @@ static NTSTATUS pipe_cm_connect(TALLOC_CTX *mem_ctx,
        struct client_pipe_connection *p;
        NTSTATUS status;
 
-       p = TALLOC_ZERO_ARRAY(mem_ctx, struct client_pipe_connection, 1);
+       p = talloc_zero_array(mem_ctx, struct client_pipe_connection, 1);
        if (!p) {
                return NT_STATUS_NO_MEMORY;
        }
index 4295d9f7bbf7ba52f8b9b9f3fd2df2c021601eef..710ec3790f21a05e91966ce04aedc68098255a64 100644 (file)
@@ -1157,7 +1157,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_0_buffer(TALLOC_CTX *mem_ct
        struct GROUP_INFO_0 *g0;
        int i;
 
-       g0 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_0, groups->count);
+       g0 = talloc_zero_array(mem_ctx, struct GROUP_INFO_0, groups->count);
        W_ERROR_HAVE_NO_MEMORY(g0);
 
        for (i=0; i<groups->count; i++) {
@@ -1183,7 +1183,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_1_buffer(TALLOC_CTX *mem_ct
        struct GROUP_INFO_1 *g1;
        int i;
 
-       g1 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_1, groups->count);
+       g1 = talloc_zero_array(mem_ctx, struct GROUP_INFO_1, groups->count);
        W_ERROR_HAVE_NO_MEMORY(g1);
 
        for (i=0; i<groups->count; i++) {
@@ -1211,7 +1211,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_2_buffer(TALLOC_CTX *mem_ct
        struct GROUP_INFO_2 *g2;
        int i;
 
-       g2 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_2, groups->count);
+       g2 = talloc_zero_array(mem_ctx, struct GROUP_INFO_2, groups->count);
        W_ERROR_HAVE_NO_MEMORY(g2);
 
        for (i=0; i<groups->count; i++) {
@@ -1242,7 +1242,7 @@ static WERROR convert_samr_disp_groups_to_GROUP_INFO_3_buffer(TALLOC_CTX *mem_ct
        struct GROUP_INFO_3 *g3;
        int i;
 
-       g3 = TALLOC_ZERO_ARRAY(mem_ctx, struct GROUP_INFO_3, groups->count);
+       g3 = talloc_zero_array(mem_ctx, struct GROUP_INFO_3, groups->count);
        W_ERROR_HAVE_NO_MEMORY(g3);
 
        for (i=0; i<groups->count; i++) {
index 54ec14eb84dec970152180c342557b1ed811140c..816afc230ff9e8e99c52191b1386c12a59a522ed 100644 (file)
@@ -1115,7 +1115,7 @@ static WERROR NetLocalGroupModifyMembers_r(struct libnetapi_ctx *ctx,
        ZERO_STRUCT(domain_handle);
        ZERO_STRUCT(alias_handle);
 
-       member_sids = TALLOC_ZERO_ARRAY(ctx, struct dom_sid,
+       member_sids = talloc_zero_array(ctx, struct dom_sid,
                                        r->in.total_entries);
        W_ERROR_HAVE_NO_MEMORY(member_sids);
 
index f1182100c7056eb6d0bc864d666290c4751225a2..3003a3939717973e505ecd1763abaeca97d8e251 100644 (file)
@@ -1436,7 +1436,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_USER(TALLOC_CTX *mem_ctx,
        struct NET_DISPLAY_USER *user = NULL;
        int i;
 
-       user = TALLOC_ZERO_ARRAY(mem_ctx,
+       user = talloc_zero_array(mem_ctx,
                                 struct NET_DISPLAY_USER,
                                 info->count);
        W_ERROR_HAVE_NO_MEMORY(user);
@@ -1480,7 +1480,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_MACHINE(TALLOC_CTX *mem_ctx,
        struct NET_DISPLAY_MACHINE *machine = NULL;
        int i;
 
-       machine = TALLOC_ZERO_ARRAY(mem_ctx,
+       machine = talloc_zero_array(mem_ctx,
                                    struct NET_DISPLAY_MACHINE,
                                    info->count);
        W_ERROR_HAVE_NO_MEMORY(machine);
@@ -1522,7 +1522,7 @@ static WERROR convert_samr_dispinfo_to_NET_DISPLAY_GROUP(TALLOC_CTX *mem_ctx,
        struct NET_DISPLAY_GROUP *group = NULL;
        int i;
 
-       group = TALLOC_ZERO_ARRAY(mem_ctx,
+       group = talloc_zero_array(mem_ctx,
                                  struct NET_DISPLAY_GROUP,
                                  info->count);
        W_ERROR_HAVE_NO_MEMORY(group);
index 5b01d11bc6271b87e4d0a0dc993cec72eddf0813..d44adaf915b32b36f98cec8e3da27a871b93a6c4 100644 (file)
@@ -1521,7 +1521,7 @@ int poll_one_fd(int fd, int events, int timeout, int *revents)
        int ret;
        int saved_errno;
 
-       fds = TALLOC_ZERO_ARRAY(talloc_tos(), struct pollfd, 2);
+       fds = talloc_zero_array(talloc_tos(), struct pollfd, 2);
        if (fds == NULL) {
                errno = ENOMEM;
                return -1;
index c1332849bff6bc5988327b844c1880cf87acea60..5eae10ec28593fe572d08bea993a4080de26f959 100644 (file)
@@ -442,7 +442,7 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
                answer_count));
 
        if (answer_count) {
-               if ((dcs = TALLOC_ZERO_ARRAY(ctx, struct dns_rr_srv,
+               if ((dcs = talloc_zero_array(ctx, struct dns_rr_srv,
                                                answer_count)) == NULL ) {
                        DEBUG(0,("ads_dns_lookup_srv: "
                                "talloc() failure for %d char*'s\n",
index 5d75383ccc7f05aa670a0d2dd95b7876607b84a9..005481d1841a4c1b1aa0e643d591bc4a6be6bf81 100644 (file)
@@ -807,7 +807,7 @@ static struct berval **ads_dup_values(TALLOC_CTX *ctx,
        if (!in_vals) return NULL;
        for (i=0; in_vals[i]; i++)
                ; /* count values */
-       values = TALLOC_ZERO_ARRAY(ctx, struct berval *, i+1);
+       values = talloc_zero_array(ctx, struct berval *, i+1);
        if (!values) return NULL;
 
        for (i=0; in_vals[i]; i++) {
@@ -828,7 +828,7 @@ static char **ads_push_strvals(TALLOC_CTX *ctx, const char **in_vals)
        if (!in_vals) return NULL;
        for (i=0; in_vals[i]; i++)
                ; /* count values */
-       values = TALLOC_ZERO_ARRAY(ctx, char *, i+1);
+       values = talloc_zero_array(ctx, char *, i+1);
        if (!values) return NULL;
 
        for (i=0; in_vals[i]; i++) {
@@ -852,7 +852,7 @@ static char **ads_pull_strvals(TALLOC_CTX *ctx, const char **in_vals)
        if (!in_vals) return NULL;
        for (i=0; in_vals[i]; i++)
                ; /* count values */
-       values = TALLOC_ZERO_ARRAY(ctx, char *, i+1);
+       values = talloc_zero_array(ctx, char *, i+1);
        if (!values) return NULL;
 
        for (i=0; in_vals[i]; i++) {
@@ -1385,7 +1385,7 @@ ADS_MODLIST ads_init_mods(TALLOC_CTX *ctx)
 #define ADS_MODLIST_ALLOC_SIZE 10
        LDAPMod **mods;
 
-       if ((mods = TALLOC_ZERO_ARRAY(ctx, LDAPMod *, ADS_MODLIST_ALLOC_SIZE + 1)))
+       if ((mods = talloc_zero_array(ctx, LDAPMod *, ADS_MODLIST_ALLOC_SIZE + 1)))
                /* -1 is safety to make sure we don't go over the end.
                   need to reset it to NULL before doing ldap modify */
                mods[ADS_MODLIST_ALLOC_SIZE] = (LDAPMod *) -1;
@@ -3287,7 +3287,7 @@ ADS_STATUS ads_get_sid_from_extended_dn(TALLOC_CTX *mem_ctx,
                return 0;
        }
 
-       (*sids) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, dn_count + 1);
+       (*sids) = talloc_zero_array(mem_ctx, struct dom_sid, dn_count + 1);
        if (!(*sids)) {
                TALLOC_FREE(dn_strings);
                return 0;
index a8eb3c9d1106c918142e7bb2851a0f4684105084..f535e28e338f4f5851b974ddd8e8599683ae0802 100644 (file)
@@ -993,8 +993,8 @@ static NTSTATUS ldif_init_context(TALLOC_CTX *mem_ctx,
        }
 
        /* Allocate initial memory for groupmap and accountmap arrays */
-       r->groupmap = TALLOC_ZERO_ARRAY(mem_ctx, GROUPMAP, 8);
-       r->accountmap = TALLOC_ZERO_ARRAY(mem_ctx, ACCOUNTMAP, 8);
+       r->groupmap = talloc_zero_array(mem_ctx, GROUPMAP, 8);
+       r->accountmap = talloc_zero_array(mem_ctx, ACCOUNTMAP, 8);
        if (r->groupmap == NULL || r->accountmap == NULL) {
                DEBUG(1,("GROUPMAP talloc failed\n"));
                status = NT_STATUS_NO_MEMORY;
index d8928c85a68b10b0395984b3ba3015b40c615622..0cf2ed3323d995161f98b6994b4ccca9beb47213 100644 (file)
@@ -476,7 +476,7 @@ static NTSTATUS fetch_group_mem_info(TALLOC_CTX *mem_ctx,
        d_printf("Group members of %s: ", grp->gr_name);
 
        if (r->num_rids) {
-               if ((nt_members = TALLOC_ZERO_ARRAY(mem_ctx, char *, r->num_rids)) == NULL) {
+               if ((nt_members = talloc_zero_array(mem_ctx, char *, r->num_rids)) == NULL) {
                        DEBUG(0, ("talloc failed\n"));
                        return NT_STATUS_NO_MEMORY;
                }
index ad5685361bcba550a592d349dfff415fc1d2d920..900c04a6ef1abdbb3a9448ba9a35742413cda3e8 100644 (file)
@@ -161,7 +161,7 @@ struct tevent_req *cli_setpathinfo_send(TALLOC_CTX *mem_ctx,
        SSVAL(&state->setup, 0, TRANSACT2_SETPATHINFO);
 
        /* Setup param array. */
-       state->param = TALLOC_ZERO_ARRAY(state, uint8_t, 6);
+       state->param = talloc_zero_array(state, uint8_t, 6);
        if (tevent_req_nomem(state->param, req)) {
                return tevent_req_post(req, ev);
        }
index 223309f75661000f82ca808860ba785105b254d9..c19151e5b818c3f9341f5c1b06dcbae239306ee8 100644 (file)
@@ -467,7 +467,7 @@ struct tevent_req *cli_pull_send(TALLOC_CTX *mem_ctx,
        state->num_reqs = MAX(window_size/state->chunk_size, 1);
        state->num_reqs = MIN(state->num_reqs, cli->max_mux);
 
-       state->reqs = TALLOC_ZERO_ARRAY(state, struct cli_pull_subreq,
+       state->reqs = talloc_zero_array(state, struct cli_pull_subreq,
                                        state->num_reqs);
        if (state->reqs == NULL) {
                goto failed;
@@ -1149,7 +1149,7 @@ struct tevent_req *cli_push_send(TALLOC_CTX *mem_ctx, struct event_context *ev,
        state->num_reqs = MIN(state->num_reqs, cli->max_mux);
        state->num_reqs = MAX(state->num_reqs, 1);
 
-       state->reqs = TALLOC_ZERO_ARRAY(state, struct cli_push_write_state *,
+       state->reqs = talloc_zero_array(state, struct cli_push_write_state *,
                                        state->num_reqs);
        if (state->reqs == NULL) {
                goto failed;
index c6add7ecdd4502b33992f15a7070ea73705a5b60..5df833f40f843040db30446e34fef72fee6d7371 100644 (file)
@@ -498,7 +498,7 @@ static NTSTATUS discover_dc_netbios(TALLOC_CTX *mem_ctx,
                return status;
        }
 
-       dclist = TALLOC_ZERO_ARRAY(mem_ctx, struct ip_service_name, count);
+       dclist = talloc_zero_array(mem_ctx, struct ip_service_name, count);
        if (!dclist) {
                SAFE_FREE(iplist);
                return NT_STATUS_NO_MEMORY;
@@ -579,7 +579,7 @@ static NTSTATUS discover_dc_dns(TALLOC_CTX *mem_ctx,
                numaddrs += MAX(dcs[i].num_ips,1);
        }
 
-       dclist = TALLOC_ZERO_ARRAY(mem_ctx,
+       dclist = talloc_zero_array(mem_ctx,
                                   struct ip_service_name,
                                   numaddrs);
        if (!dclist) {
index c5f32520d94a4e2f31c894fbda234650692abe31..eb79b2ba93641f9727f327bb323f83cb35b875d2 100644 (file)
@@ -208,13 +208,13 @@ bool enumerate_domain_trusts( TALLOC_CTX *mem_ctx, const char *domain,
 
        *num_domains = dom_list.count;
 
-       *domain_names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_domains);
+       *domain_names = talloc_zero_array(mem_ctx, char *, *num_domains);
        if (!*domain_names) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
        }
 
-       *sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_domains);
+       *sids = talloc_zero_array(mem_ctx, struct dom_sid, *num_domains);
        if (!*sids) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
index fc9c3cd2d41fd76b8e8db044e7960e6a5d9f85ac..bee7966dfc93d87f30de3edf6bf5824a1fd3e4db 100644 (file)
@@ -179,7 +179,7 @@ static void add_directory_inheritable_components(vfs_handle_struct *handle,
        mode_t dir_mode;
        mode_t file_mode;
        mode_t mode;
-       struct security_ace *new_ace_list = TALLOC_ZERO_ARRAY(talloc_tos(),
+       struct security_ace *new_ace_list = talloc_zero_array(talloc_tos(),
                                                struct security_ace,
                                                num_aces + 3);
 
index 6ec25c45c1cfb5b4b0cbd80b1b59291225379b7d..3d51849287cb10394a544965aa7b4100ca783670 100644 (file)
@@ -1707,7 +1707,7 @@ static bool create_listen_pollfds(struct pollfd **pfds,
                }
        }
 
-       fds = TALLOC_ZERO_ARRAY(NULL, struct pollfd, count);
+       fds = talloc_zero_array(NULL, struct pollfd, count);
        if (fds == NULL) {
                DEBUG(1, ("create_listen_pollfds: malloc fail for fds. "
                          "size %d\n", count));
index bb193f3cddedc39b70a4afbdd5dc6adc73742a29..8b5330c097452827b3546a3ef309fe07057b4fa3 100644 (file)
@@ -482,7 +482,7 @@ static bool lookup_rids(TALLOC_CTX *mem_ctx, const struct dom_sid *domain_sid,
                   sid_string_dbg(domain_sid)));
 
        if (num_rids) {
-               *names = TALLOC_ZERO_ARRAY(mem_ctx, const char *, num_rids);
+               *names = talloc_zero_array(mem_ctx, const char *, num_rids);
                *types = talloc_array(mem_ctx, enum lsa_SidType, num_rids);
 
                if ((*names == NULL) || (*types == NULL)) {
@@ -759,7 +759,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
                name_infos = NULL;
        }
 
-       dom_infos = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_dom_info,
+       dom_infos = talloc_zero_array(mem_ctx, struct lsa_dom_info,
                                      LSA_REF_DOMAIN_LIST_MULTIPLIER);
        if (dom_infos == NULL) {
                result = NT_STATUS_NO_MEMORY;
index d6f791053d45190aeffa52d87258f07031858718..b3d62bc61cb4a3edca32fe802cb31515d54137b2 100644 (file)
@@ -1518,7 +1518,7 @@ static NTSTATUS pdb_default_enum_group_members(struct pdb_methods *methods,
        if (num_uids == 0)
                return NT_STATUS_OK;
 
-       *pp_member_rids = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_uids);
+       *pp_member_rids = talloc_zero_array(mem_ctx, uint32_t, num_uids);
 
        for (i=0; i<num_uids; i++) {
                struct dom_sid sid;
index 1ba8915b4c8c2797c4f9ff974663577c103b7c82..cac0e5b4c3bbf5c31b562aea5baae9c6ec8cd08b 100644 (file)
@@ -945,7 +945,7 @@ static bool _reg_perfcount_init_data_block(struct PERF_DATA_BLOCK *block,
        memset(temp, 0, sizeof(temp));
        rpcstr_push((void *)temp, global_myname(), sizeof(temp), STR_TERMINATE);
        block->SystemNameLength = (strlen_w(temp) * 2) + 2;
-       block->data = TALLOC_ZERO_ARRAY(mem_ctx, uint8, block->SystemNameLength + (8 - (block->SystemNameLength % 8)));
+       block->data = talloc_zero_array(mem_ctx, uint8, block->SystemNameLength + (8 - (block->SystemNameLength % 8)));
        if (block->data == NULL) {
                return False;
        }
index c1d40166ccd74973fa080dd6cf8f96541b324d8d..b698a04b6ec0b6d7e0af57132f30ca20d4110c42 100644 (file)
@@ -1898,7 +1898,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
                
                nk->subkeys.num_keys = nk->num_subkeys;
                if (nk->subkeys.num_keys) {
-                       if ( !(nk->subkeys.hashes = TALLOC_ZERO_ARRAY( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) )
+                       if ( !(nk->subkeys.hashes = talloc_zero_array( file->mem_ctx, REGF_HASH_REC, nk->subkeys.num_keys )) )
                                return NULL;
                } else {
                        nk->subkeys.hashes = NULL;
index cb9eae297c87bc3ac8743a8cebd6af13c5fec163..c6f45eaad0fc7c0370a6a7f80b5b7f6b3038a10a 100644 (file)
@@ -520,7 +520,7 @@ NTSTATUS _lsa_EnumTrustDom(struct pipes_struct *p,
                return nt_status;
        }
 
-       entries = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_DomainInfo, count);
+       entries = talloc_zero_array(p->mem_ctx, struct lsa_DomainInfo, count);
        if (!entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -681,7 +681,7 @@ NTSTATUS _lsa_QueryInfoPolicy(struct pipes_struct *p,
 
                info->audit_events.auditing_mode = true;
                info->audit_events.count = LSA_AUDIT_NUM_CATEGORIES;
-               info->audit_events.settings = TALLOC_ZERO_ARRAY(p->mem_ctx,
+               info->audit_events.settings = talloc_zero_array(p->mem_ctx,
                                                                enum lsa_PolicyAuditPolicy,
                                                                info->audit_events.count);
                if (!info->audit_events.settings) {
@@ -1174,7 +1174,7 @@ NTSTATUS _lsa_LookupNames(struct pipes_struct *p,
        }
 
        if (num_entries) {
-               rids = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_TranslatedSid,
+               rids = talloc_zero_array(p->mem_ctx, struct lsa_TranslatedSid,
                                         num_entries);
                if (!rids) {
                        return NT_STATUS_NO_MEMORY;
@@ -1316,7 +1316,7 @@ NTSTATUS _lsa_LookupNames3(struct pipes_struct *p,
        }
 
        if (num_entries) {
-               trans_sids = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_TranslatedSid3,
+               trans_sids = talloc_zero_array(p->mem_ctx, struct lsa_TranslatedSid3,
                                               num_entries);
                if (!trans_sids) {
                        return NT_STATUS_NO_MEMORY;
@@ -2230,7 +2230,7 @@ NTSTATUS _lsa_EnumPrivs(struct pipes_struct *p,
                return NT_STATUS_ACCESS_DENIED;
 
        if (num_privs) {
-               entries = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_PrivEntry, num_privs);
+               entries = talloc_zero_array(p->mem_ctx, struct lsa_PrivEntry, num_privs);
                if (!entries) {
                        return NT_STATUS_NO_MEMORY;
                }
@@ -2351,7 +2351,7 @@ NTSTATUS _lsa_EnumAccounts(struct pipes_struct *p,
        }
 
        if (num_entries - *r->in.resume_handle) {
-               sids = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_SidPtr,
+               sids = talloc_zero_array(p->mem_ctx, struct lsa_SidPtr,
                                         num_entries - *r->in.resume_handle);
                if (!sids) {
                        talloc_free(sid_list);
@@ -3030,7 +3030,7 @@ static NTSTATUS init_lsa_right_set(TALLOC_CTX *mem_ctx,
 
        if (num_priv) {
 
-               r->names = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_StringLarge,
+               r->names = talloc_zero_array(mem_ctx, struct lsa_StringLarge,
                                             num_priv);
                if (!r->names) {
                        return NT_STATUS_NO_MEMORY;
@@ -3323,7 +3323,7 @@ NTSTATUS _lsa_EnumTrustedDomainsEx(struct pipes_struct *p,
                return nt_status;
        }
 
-       entries = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_TrustDomainInfoInfoEx,
+       entries = talloc_zero_array(p->mem_ctx, struct lsa_TrustDomainInfoInfoEx,
                                    count);
        if (!entries) {
                return NT_STATUS_NO_MEMORY;
index 9f96127c0f37d45830b321956c2be0e4e8390b9c..e5f59e604b60b2b535c1760b217b8872bb5867b0 100644 (file)
@@ -784,7 +784,7 @@ static NTSTATUS make_user_sam_entry_list(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       sam = TALLOC_ZERO_ARRAY(ctx, struct samr_SamEntry, num_entries);
+       sam = talloc_zero_array(ctx, struct samr_SamEntry, num_entries);
        if (sam == NULL) {
                DEBUG(0, ("make_user_sam_entry_list: TALLOC_ZERO failed!\n"));
                return NT_STATUS_NO_MEMORY;
@@ -938,7 +938,7 @@ static void make_group_sam_entry_list(TALLOC_CTX *ctx,
                return;
        }
 
-       sam = TALLOC_ZERO_ARRAY(ctx, struct samr_SamEntry, num_sam_entries);
+       sam = talloc_zero_array(ctx, struct samr_SamEntry, num_sam_entries);
        if (sam == NULL) {
                return;
        }
@@ -1120,7 +1120,7 @@ static NTSTATUS init_samr_dispinfo_1(TALLOC_CTX *ctx,
 
        r->count = num_entries;
 
-       r->entries = TALLOC_ZERO_ARRAY(ctx, struct samr_DispEntryGeneral, num_entries);
+       r->entries = talloc_zero_array(ctx, struct samr_DispEntryGeneral, num_entries);
        if (!r->entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -1164,7 +1164,7 @@ static NTSTATUS init_samr_dispinfo_2(TALLOC_CTX *ctx,
 
        r->count = num_entries;
 
-       r->entries = TALLOC_ZERO_ARRAY(ctx, struct samr_DispEntryFull, num_entries);
+       r->entries = talloc_zero_array(ctx, struct samr_DispEntryFull, num_entries);
        if (!r->entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -1205,7 +1205,7 @@ static NTSTATUS init_samr_dispinfo_3(TALLOC_CTX *ctx,
 
        r->count = num_entries;
 
-       r->entries = TALLOC_ZERO_ARRAY(ctx, struct samr_DispEntryFullGroup, num_entries);
+       r->entries = talloc_zero_array(ctx, struct samr_DispEntryFullGroup, num_entries);
        if (!r->entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -1246,7 +1246,7 @@ static NTSTATUS init_samr_dispinfo_4(TALLOC_CTX *ctx,
 
        r->count = num_entries;
 
-       r->entries = TALLOC_ZERO_ARRAY(ctx, struct samr_DispEntryAscii, num_entries);
+       r->entries = talloc_zero_array(ctx, struct samr_DispEntryAscii, num_entries);
        if (!r->entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -1282,7 +1282,7 @@ static NTSTATUS init_samr_dispinfo_5(TALLOC_CTX *ctx,
 
        r->count = num_entries;
 
-       r->entries = TALLOC_ZERO_ARRAY(ctx, struct samr_DispEntryAscii, num_entries);
+       r->entries = talloc_zero_array(ctx, struct samr_DispEntryAscii, num_entries);
        if (!r->entries) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -2050,7 +2050,7 @@ static bool make_samr_lookup_rids(TALLOC_CTX *ctx, uint32 num_names,
        *lsa_name_array_p = NULL;
 
        if (num_names != 0) {
-               lsa_name_array = TALLOC_ZERO_ARRAY(ctx, struct lsa_String, num_names);
+               lsa_name_array = talloc_zero_array(ctx, struct lsa_String, num_names);
                if (!lsa_name_array) {
                        return false;
                }
@@ -2100,9 +2100,9 @@ NTSTATUS _samr_LookupRids(struct pipes_struct *p,
        }
 
        if (num_rids) {
-               names = TALLOC_ZERO_ARRAY(p->mem_ctx, const char *, num_rids);
-               attrs = TALLOC_ZERO_ARRAY(p->mem_ctx, enum lsa_SidType, num_rids);
-               wire_attrs = TALLOC_ZERO_ARRAY(p->mem_ctx, uint32, num_rids);
+               names = talloc_zero_array(p->mem_ctx, const char *, num_rids);
+               attrs = talloc_zero_array(p->mem_ctx, enum lsa_SidType, num_rids);
+               wire_attrs = talloc_zero_array(p->mem_ctx, uint32, num_rids);
 
                if ((names == NULL) || (attrs == NULL) || (wire_attrs==NULL))
                        return NT_STATUS_NO_MEMORY;
@@ -2293,7 +2293,7 @@ static NTSTATUS init_samr_parameters_string(TALLOC_CTX *mem_ctx,
                return NT_STATUS_NO_MEMORY;
        }
 
-       r->array = TALLOC_ZERO_ARRAY(mem_ctx, uint16_t, blob->length/2);
+       r->array = talloc_zero_array(mem_ctx, uint16_t, blob->length/2);
        if (!r->array) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -4100,7 +4100,7 @@ NTSTATUS _samr_EnumDomains(struct pipes_struct *p,
                return NT_STATUS_NO_MEMORY;
        }
 
-       entry_array = TALLOC_ZERO_ARRAY(p->mem_ctx,
+       entry_array = talloc_zero_array(p->mem_ctx,
                                        struct samr_SamEntry,
                                        num_entries);
        if (!entry_array) {
@@ -5369,7 +5369,7 @@ NTSTATUS _samr_GetMembersInAlias(struct pipes_struct *p,
        }
 
        if (num_sids) {
-               sids = TALLOC_ZERO_ARRAY(p->mem_ctx, struct lsa_SidPtr, num_sids);
+               sids = talloc_zero_array(p->mem_ctx, struct lsa_SidPtr, num_sids);
                if (sids == NULL) {
                        TALLOC_FREE(pdb_sids);
                        return NT_STATUS_NO_MEMORY;
@@ -5439,7 +5439,7 @@ NTSTATUS _samr_QueryGroupMember(struct pipes_struct *p,
                return status;
 
        if (num_members) {
-               attr=TALLOC_ZERO_ARRAY(p->mem_ctx, uint32, num_members);
+               attr=talloc_zero_array(p->mem_ctx, uint32, num_members);
                if (attr == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
index 7fd068f1af5b0b6841bc8c753532054ef09d99d8..dd23a090f20e9d33dc38e65fd476e4b906683a07 100644 (file)
@@ -574,7 +574,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
        num_services = lp_numservices();
        unbecome_root();
 
-        allowed = TALLOC_ZERO_ARRAY(ctx, bool, num_services);
+        allowed = talloc_zero_array(ctx, bool, num_services);
         W_ERROR_HAVE_NO_MEMORY(allowed);
 
         /* Count the number of entries. */
@@ -604,7 +604,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr0);
 
                ctr.ctr0->count = alloc_entries;
-               ctr.ctr0->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo0, alloc_entries);
+               ctr.ctr0->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo0, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr0->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -621,7 +621,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1);
 
                ctr.ctr1->count = alloc_entries;
-               ctr.ctr1->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo1, alloc_entries);
+               ctr.ctr1->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo1, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -638,7 +638,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr2);
 
                ctr.ctr2->count = alloc_entries;
-               ctr.ctr2->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo2, alloc_entries);
+               ctr.ctr2->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo2, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr2->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -655,7 +655,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr501);
 
                ctr.ctr501->count = alloc_entries;
-               ctr.ctr501->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo501, alloc_entries);
+               ctr.ctr501->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo501, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr501->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -672,7 +672,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr502);
 
                ctr.ctr502->count = alloc_entries;
-               ctr.ctr502->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo502, alloc_entries);
+               ctr.ctr502->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo502, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr502->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -689,7 +689,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1004);
 
                ctr.ctr1004->count = alloc_entries;
-               ctr.ctr1004->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo1004, alloc_entries);
+               ctr.ctr1004->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo1004, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1004->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -706,7 +706,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1005);
 
                ctr.ctr1005->count = alloc_entries;
-               ctr.ctr1005->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo1005, alloc_entries);
+               ctr.ctr1005->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo1005, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1005->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -723,7 +723,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1006);
 
                ctr.ctr1006->count = alloc_entries;
-               ctr.ctr1006->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo1006, alloc_entries);
+               ctr.ctr1006->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo1006, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1006->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -740,7 +740,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1007);
 
                ctr.ctr1007->count = alloc_entries;
-               ctr.ctr1007->array = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetShareInfo1007, alloc_entries);
+               ctr.ctr1007->array = talloc_zero_array(ctx, struct srvsvc_NetShareInfo1007, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1007->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -757,7 +757,7 @@ static WERROR init_srv_share_info_ctr(struct pipes_struct *p,
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1501);
 
                ctr.ctr1501->count = alloc_entries;
-               ctr.ctr1501->array = TALLOC_ZERO_ARRAY(ctx, struct sec_desc_buf, alloc_entries);
+               ctr.ctr1501->array = talloc_zero_array(ctx, struct sec_desc_buf, alloc_entries);
                W_ERROR_HAVE_NO_MEMORY(ctr.ctr1501->array);
 
                for (snum = 0; snum < num_services; snum++) {
@@ -2438,7 +2438,7 @@ WERROR _srvsvc_NetDiskEnum(struct pipes_struct *p,
 
        *r->out.totalentries = init_server_disk_enum(&resume);
 
-       r->out.info->disks = TALLOC_ZERO_ARRAY(ctx, struct srvsvc_NetDiskInfo0,
+       r->out.info->disks = talloc_zero_array(ctx, struct srvsvc_NetDiskInfo0,
                                               MAX_SERVER_DISK_ENTRIES);
        W_ERROR_HAVE_NO_MEMORY(r->out.info->disks);
 
index 3f1ecab75035eaaa1b5451e05edc63511f8eca7c..292fa8838b2459ea78e3d2d2d5c35efe2258f8ff 100644 (file)
@@ -40,7 +40,7 @@ static WERROR cracknames(struct rpc_pipe_client *cli,
        struct drsuapi_DsNameString *names;
        struct dcerpc_binding_handle *b = cli->binding_handle;
 
-       names = TALLOC_ZERO_ARRAY(mem_ctx, struct drsuapi_DsNameString, argc);
+       names = talloc_zero_array(mem_ctx, struct drsuapi_DsNameString, argc);
        W_ERROR_HAVE_NO_MEMORY(names);
 
        for (i=0; i<argc; i++) {
index bcf4d5830d17f9543a2f02750479a0e1d821c589..24bd55abf32f78229af672718626763c90f18643 100644 (file)
@@ -728,7 +728,7 @@ static NTSTATUS cmd_samr_query_useraliases(struct rpc_pipe_client *cli,
        }
 
        if (num_sids) {
-               sid_array.sids = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_SidPtr, num_sids);
+               sid_array.sids = talloc_zero_array(mem_ctx, struct lsa_SidPtr, num_sids);
                if (sid_array.sids == NULL)
                        return NT_STATUS_NO_MEMORY;
        } else {
index 83590ea6c00508935cae6bb3f79ca30dbca3c0f1..c547cd2afab29c9d2e4390f2c49787451f76a529 100644 (file)
@@ -1559,7 +1559,7 @@ void DirCacheAdd(struct smb_Dir *dirp, const char *name, long offset)
        }
 
        if (dirp->name_cache == NULL) {
-               dirp->name_cache = TALLOC_ZERO_ARRAY(
+               dirp->name_cache = talloc_zero_array(
                        dirp, struct name_cache_entry, dirp->name_cache_size);
 
                if (dirp->name_cache == NULL) {
index af560ed19b432ccaeb76d3e1b070831c397242de..47c2b1ee7869369c0c1a3ce1a7ffaa3ba9669f63 100644 (file)
@@ -378,7 +378,7 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
        DEBUG(10,("parse_msdfs_symlink: count=%d\n", count));
 
        if (count) {
-               reflist = *preflist = TALLOC_ZERO_ARRAY(ctx,
+               reflist = *preflist = talloc_zero_array(ctx,
                                struct referral, count);
                if(reflist == NULL) {
                        TALLOC_FREE(alt_path);
index c536306e2241803aea682d3271124dbd3ea1fa1e..da25a52b8dbdc473e470b7bd0a18a7665d0e9d75 100644 (file)
@@ -3687,7 +3687,7 @@ NTSTATUS append_parent_acl(files_struct *fsp,
 
        num_aces += parent_sd->dacl->num_aces;
 
-       if((new_ace = TALLOC_ZERO_ARRAY(mem_ctx, struct security_ace,
+       if((new_ace = talloc_zero_array(mem_ctx, struct security_ace,
                                        num_aces)) == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index 26aed240a1839042a36bbf723b631fc2e87c7597..a8ce9b7d482385a6e4a58f7b7b0440448c0d8238 100644 (file)
@@ -2957,7 +2957,7 @@ static NTSTATUS rpc_list_alias_members(struct net_context *c,
                return result;
        }
 
-       alias_sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_members);
+       alias_sids = talloc_zero_array(mem_ctx, struct dom_sid, num_members);
        if (!alias_sids) {
                d_fprintf(stderr, _("Out of memory\n"));
                TALLOC_FREE(lsa_pipe);
index 929273dd79e9684b1149cd9f0d027560c917a35d..fedc432c5a6f91f7a9650e822dcaa067deb36c09 100644 (file)
@@ -211,9 +211,9 @@ static NTSTATUS registry_enumkeys(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       if ((!(names = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_subkeys))) ||
-           (!(classes = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_subkeys))) ||
-           (!(modtimes = TALLOC_ZERO_ARRAY(mem_ctx, NTTIME *,
+       if ((!(names = talloc_zero_array(mem_ctx, char *, num_subkeys))) ||
+           (!(classes = talloc_zero_array(mem_ctx, char *, num_subkeys))) ||
+           (!(modtimes = talloc_zero_array(mem_ctx, NTTIME *,
                                            num_subkeys)))) {
                status = NT_STATUS_NO_MEMORY;
                goto error;
index 1d7c6c129432057c59a273e84f590ee600166389..ab52e4727a25f7015fe2e3769be40441f710ca72 100644 (file)
@@ -312,7 +312,7 @@ static struct security_descriptor* parse_acl_string(TALLOC_CTX *mem_ctx, const c
        pacl = szACL;
        num_ace = count_chars( pacl, ',' ) + 1;
 
-       if ( !(ace = TALLOC_ZERO_ARRAY( mem_ctx, struct security_ace, num_ace )) )
+       if ( !(ace = talloc_zero_array( mem_ctx, struct security_ace, num_ace )) )
                return NULL;
 
        for ( i=0; i<num_ace; i++ ) {
index 474387918e48354d27664958a0b5d59306b16014..a6e883c47466d1b6d85ff5125fe871702202b994 100644 (file)
@@ -127,7 +127,7 @@ static NTSTATUS be_init(struct idmap_domain *dom)
 
        /* Create the hash table of domain SIDs */
 
-       hashed_domains = TALLOC_ZERO_ARRAY(dom, struct sid_hash_table, 4096);
+       hashed_domains = talloc_zero_array(dom, struct sid_hash_table, 4096);
        BAIL_ON_PTR_NT_ERROR(hashed_domains, nt_status);
 
        /* create the hash table of domain SIDs */
index 770ed43aa006c93fca0c52965de368574831da85..610db7a62b62e66a61f6056ab01988157297bc66 100644 (file)
@@ -199,7 +199,7 @@ static NTSTATUS query_user_list(struct winbindd_domain *domain,
                goto done;
        }
 
-       (*pinfo) = TALLOC_ZERO_ARRAY(mem_ctx, struct wbint_userinfo, count);
+       (*pinfo) = talloc_zero_array(mem_ctx, struct wbint_userinfo, count);
        if (!*pinfo) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
@@ -351,7 +351,7 @@ static NTSTATUS enum_dom_groups(struct winbindd_domain *domain,
                goto done;
        }
 
-       (*info) = TALLOC_ZERO_ARRAY(mem_ctx, struct wb_acct_info, count);
+       (*info) = talloc_zero_array(mem_ctx, struct wb_acct_info, count);
        if (!*info) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
@@ -769,7 +769,7 @@ static NTSTATUS lookup_usergroups_memberof(struct winbindd_domain *domain,
                goto done;
        }
 
-       group_sids = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_strings + 1);
+       group_sids = talloc_zero_array(mem_ctx, struct dom_sid, num_strings + 1);
        if (!group_sids) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
@@ -1085,10 +1085,10 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
         * cache. Only the rest is passed to the lsa_lookup_sids call. */
 
        if (num_members) {
-               (*sid_mem) = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_members);
-               (*names) = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_members);
-               (*name_types) = TALLOC_ZERO_ARRAY(mem_ctx, uint32, num_members);
-               (sid_mem_nocache) = TALLOC_ZERO_ARRAY(tmp_ctx, struct dom_sid, num_members);
+               (*sid_mem) = talloc_zero_array(mem_ctx, struct dom_sid, num_members);
+               (*names) = talloc_zero_array(mem_ctx, char *, num_members);
+               (*name_types) = talloc_zero_array(mem_ctx, uint32, num_members);
+               (sid_mem_nocache) = talloc_zero_array(tmp_ctx, struct dom_sid, num_members);
 
                if ((members == NULL) || (*sid_mem == NULL) ||
                    (*names == NULL) || (*name_types == NULL) ||
index 05261b70b0fc787140ce4a889b2cbfff69261eab..1c4f5bd701f9eea641c41171d95f235d20af5524 100644 (file)
@@ -2774,7 +2774,7 @@ static NTSTATUS trusted_domains(struct winbindd_domain *domain,
        }
 
 do_fetch_cache:
-       trusts->array = TALLOC_ZERO_ARRAY(mem_ctx, struct netr_DomainTrust, num_domains);
+       trusts->array = talloc_zero_array(mem_ctx, struct netr_DomainTrust, num_domains);
        if (!trusts->array) {
                TALLOC_FREE(dom_list);
                return NT_STATUS_NO_MEMORY;
index 699320206a231a577e5982a1affde62f3a3e028d..9ef0d87f5ad04b7daeb176c99e1cf3b601084616 100644 (file)
@@ -701,9 +701,9 @@ static NTSTATUS msrpc_lookup_groupmem(struct winbindd_domain *domain,
 
 #define MAX_LOOKUP_RIDS 900
 
-        *names = TALLOC_ZERO_ARRAY(mem_ctx, char *, *num_names);
-        *name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32, *num_names);
-        *sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, *num_names);
+        *names = talloc_zero_array(mem_ctx, char *, *num_names);
+        *name_types = talloc_zero_array(mem_ctx, uint32, *num_names);
+        *sid_mem = talloc_zero_array(mem_ctx, struct dom_sid, *num_names);
 
        for (j=0;j<(*num_names);j++)
                sid_compose(&(*sid_mem)[j], &domain->sid, rid_mem[j]);
index bb1aa04bfa09de0e30e7bb453b4659a8afae2596..e91148732422a89e21381c035f40b5364a9909f5 100644 (file)
@@ -644,7 +644,7 @@ NTSTATUS rpc_lookup_useraliases(TALLOC_CTX *mem_ctx,
                        num_queries, num_query_sids));
 
                if (num_query_sids) {
-                       sid_array.sids = TALLOC_ZERO_ARRAY(mem_ctx, struct lsa_SidPtr, num_query_sids);
+                       sid_array.sids = talloc_zero_array(mem_ctx, struct lsa_SidPtr, num_query_sids);
                        if (sid_array.sids == NULL) {
                                return NT_STATUS_NO_MEMORY;
                        }
@@ -839,9 +839,9 @@ NTSTATUS rpc_lookup_groupmem(TALLOC_CTX *mem_ctx,
         * Step #2: Convert list of rids into list of usernames.
         */
        if (num_names > 0) {
-               names = TALLOC_ZERO_ARRAY(mem_ctx, char *, num_names);
-               name_types = TALLOC_ZERO_ARRAY(mem_ctx, uint32_t, num_names);
-               sid_mem = TALLOC_ZERO_ARRAY(mem_ctx, struct dom_sid, num_names);
+               names = talloc_zero_array(mem_ctx, char *, num_names);
+               name_types = talloc_zero_array(mem_ctx, uint32_t, num_names);
+               sid_mem = talloc_zero_array(mem_ctx, struct dom_sid, num_names);
                if (names == NULL || name_types == NULL || sid_mem == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
index 203ccfce091fbe02cf7dee45eb283367f3c2bca2..f6e2d82cce7893349d97a6bef2e1bd7d508eea4d 100644 (file)
@@ -80,7 +80,7 @@ struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
 
        DEBUG(10, ("num_sids: %d\n", (int)state->num_sids));
 
-       state->cached = TALLOC_ZERO_ARRAY(state, struct id_map,
+       state->cached = talloc_zero_array(state, struct id_map,
                                          state->num_sids);
        if (tevent_req_nomem(state->cached, req)) {
                return tevent_req_post(req, ev);