s3-talloc Change TALLOC_ARRAY() to talloc_array()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 7 Jun 2011 01:30:12 +0000 (11:30 +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_ARRAY isn't standard talloc.

84 files changed:
lib/addns/dnsmarshall.c
lib/addns/dnsrecord.c
lib/addns/dnssock.c
lib/addns/dnsutils.c
libgpo/gpo_ldap.c
source3/auth/auth_util.c
source3/auth/token_util.c
source3/client/dnsbrowse.c
source3/groupdb/mapping.c
source3/groupdb/mapping_tdb.c
source3/include/smb_macros.h
source3/lib/dbwrap_file.c
source3/lib/g_lock.c
source3/lib/netapi/user.c
source3/lib/sharesec.c
source3/lib/smbldap.c
source3/lib/system.c
source3/lib/util_str.c
source3/lib/winbind_util.c
source3/libads/dns.c
source3/libads/kerberos.c
source3/libads/ldap.c
source3/libads/ldap_printer.c
source3/libads/ldap_schema.c
source3/libads/ldap_utils.c
source3/libnet/libnet_dssync_keytab.c
source3/libsmb/clifile.c
source3/libsmb/clilist.c
source3/libsmb/clirap.c
source3/libsmb/clireadwrite.c
source3/libsmb/clitrans.c
source3/libsmb/libsmb_path.c
source3/libsmb/namequery.c
source3/locking/locking.c
source3/locking/posix.c
source3/modules/vfs_afsacl.c
source3/modules/vfs_cap.c
source3/modules/vfs_expand_msdfs.c
source3/modules/vfs_preopen.c
source3/modules/vfs_scannedonly.c
source3/nmbd/nmbd_packets.c
source3/passdb/lookup_sid.c
source3/passdb/pdb_interface.c
source3/passdb/pdb_ipa.c
source3/passdb/pdb_ldap.c
source3/passdb/pdb_wbc_sam.c
source3/passdb/secrets.c
source3/printing/notify.c
source3/registry/reg_backend_db.c
source3/registry/regfio.c
source3/rpc_client/cli_lsarpc.c
source3/rpc_client/cli_pipe.c
source3/rpc_server/dfs/srv_dfs_nt.c
source3/rpc_server/echo/srv_echo_nt.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/rpc_server/samr/srv_samr_nt.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/rpc_server/spoolss/srv_spoolss_util.c
source3/rpc_server/svcctl/srv_svcctl_nt.c
source3/rpc_server/winreg/srv_winreg_nt.c
source3/rpcclient/cmd_lsarpc.c
source3/rpcclient/cmd_samr.c
source3/smbd/ipc.c
source3/smbd/msdfs.c
source3/smbd/open.c
source3/smbd/oplock.c
source3/smbd/process.c
source3/smbd/reply.c
source3/smbd/trans2.c
source3/torture/cmd_vfs.c
source3/torture/masktest.c
source3/torture/torture.c
source3/utils/eventlogadm.c
source3/utils/net_rpc_registry.c
source3/utils/net_rpc_rights.c
source3/web/swat.c
source3/winbindd/idmap.c
source3/winbindd/idmap_adex/gc_util.c
source3/winbindd/wb_lookupsids.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_msrpc.c
source3/winbindd/winbindd_rpc.c
source3/winbindd/winbindd_sids_to_xids.c
source3/winbindd/winbindd_wins.c

index e5e8cf796217b58483d621e678df6e4ca2e5d5fa..3401b31469df37ffb4261359d762cf6f8bd9e992 100644 (file)
@@ -39,7 +39,7 @@ struct dns_buffer *dns_create_buffer(TALLOC_CTX *mem_ctx)
         */
        result->size = 2;
 
-       if (!(result->data = TALLOC_ARRAY(result, uint8, result->size))) {
+       if (!(result->data = talloc_array(result, uint8, result->size))) {
                TALLOC_FREE(result);
                return NULL;
        }
@@ -223,7 +223,7 @@ static void dns_unmarshall_label(TALLOC_CTX *mem_ctx,
 
        label->len = len;
 
-       if (!(label->label = TALLOC_ARRAY(label, char, len+1))) {
+       if (!(label->label = talloc_array(label, char, len+1))) {
                buf->error = ERROR_DNS_NO_MEMORY;
                goto error;
        }
@@ -329,7 +329,7 @@ static void dns_unmarshall_rr(TALLOC_CTX *mem_ctx,
        if (!(ERR_DNS_IS_OK(buf->error))) return;
 
        if (r->data_length != 0) {
-               if (!(r->data = TALLOC_ARRAY(r, uint8, r->data_length))) {
+               if (!(r->data = talloc_array(r, uint8, r->data_length))) {
                        buf->error = ERROR_DNS_NO_MEMORY;
                        return;
                }
@@ -406,22 +406,22 @@ DNS_ERROR dns_unmarshall_request(TALLOC_CTX *mem_ctx,
        err = ERROR_DNS_NO_MEMORY;
 
        if ((req->num_questions != 0) &&
-           !(req->questions = TALLOC_ARRAY(req, struct dns_question *,
+           !(req->questions = talloc_array(req, struct dns_question *,
                                            req->num_questions))) {
                goto error;
        }
        if ((req->num_answers != 0) &&
-           !(req->answers = TALLOC_ARRAY(req, struct dns_rrec *,
+           !(req->answers = talloc_array(req, struct dns_rrec *,
                                          req->num_answers))) {
                goto error;
        }
        if ((req->num_auths != 0) &&
-           !(req->auths = TALLOC_ARRAY(req, struct dns_rrec *,
+           !(req->auths = talloc_array(req, struct dns_rrec *,
                                        req->num_auths))) {
                goto error;
        }
        if ((req->num_additionals != 0) &&
-           !(req->additionals = TALLOC_ARRAY(req, struct dns_rrec *,
+           !(req->additionals = talloc_array(req, struct dns_rrec *,
                                              req->num_additionals))) {
                goto error;
        }
index 52391aef78080c57bb65879288c88e8966d34b5d..2d0dc9ec5bea6d9f3cb787a942dd8f8e47f83df9 100644 (file)
@@ -32,7 +32,7 @@ DNS_ERROR dns_create_query( TALLOC_CTX *mem_ctx, const char *name,
        DNS_ERROR err;
 
        if (!(req = TALLOC_ZERO_P(mem_ctx, struct dns_request)) ||
-           !(req->questions = TALLOC_ARRAY(req, struct dns_question *, 1)) ||
+           !(req->questions = talloc_array(req, struct dns_question *, 1)) ||
            !(req->questions[0] = talloc(req->questions,
                                         struct dns_question))) {
                TALLOC_FREE(req);
@@ -65,7 +65,7 @@ DNS_ERROR dns_create_update( TALLOC_CTX *mem_ctx, const char *name,
        DNS_ERROR err;
 
        if (!(req = TALLOC_ZERO_P(mem_ctx, struct dns_update_request)) ||
-           !(req->zones = TALLOC_ARRAY(req, struct dns_zone *, 1)) ||
+           !(req->zones = talloc_array(req, struct dns_zone *, 1)) ||
            !(req->zones[0] = talloc(req->zones, struct dns_zone))) {
                TALLOC_FREE(req);
                return ERROR_DNS_NO_MEMORY;
@@ -240,7 +240,7 @@ DNS_ERROR dns_unmarshall_tkey_record(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
        if (!ERR_DNS_IS_OK(buf.error)) goto error;
 
        if (tkey->key_length) {
-               if (!(tkey->key = TALLOC_ARRAY(tkey, uint8, tkey->key_length))) {
+               if (!(tkey->key = talloc_array(tkey, uint8, tkey->key_length))) {
                        buf.error = ERROR_DNS_NO_MEMORY;
                        goto error;
                }
index 42b4e2d40f0457ae2d426236fb715e411e341ddf..da8a52100e31eae7582d5cd74b6818a4bd861ffc 100644 (file)
@@ -262,7 +262,7 @@ static DNS_ERROR dns_receive_tcp(TALLOC_CTX *mem_ctx,
        buf->size = ntohs(len);
 
        if (buf->size) {
-               if (!(buf->data = TALLOC_ARRAY(buf, uint8, buf->size))) {
+               if (!(buf->data = talloc_array(buf, uint8, buf->size))) {
                        TALLOC_FREE(buf);
                        return ERROR_DNS_NO_MEMORY;
                }
@@ -295,7 +295,7 @@ static DNS_ERROR dns_receive_udp(TALLOC_CTX *mem_ctx,
         * UDP based DNS can only be 512 bytes
         */
 
-       if (!(buf->data = TALLOC_ARRAY(buf, uint8, 512))) {
+       if (!(buf->data = talloc_array(buf, uint8, 512))) {
                TALLOC_FREE(buf);
                return ERROR_DNS_NO_MEMORY;
        }
index 37b862c7f0798121e8f71c10a39146074798b915..526179bee3a667471f0fe807aa9e4016e1dddf6a 100644 (file)
@@ -138,7 +138,7 @@ char *dns_generate_keyname( TALLOC_CTX *mem_ctx )
        /*
         * uuid_unparse gives 36 bytes plus '\0'
         */
-       if (!(result = TALLOC_ARRAY(mem_ctx, char, 37))) {
+       if (!(result = talloc_array(mem_ctx, char, 37))) {
                return NULL;
        }
 
index 6abaf29cf0d333d6f7e572dc5786a4e1b4a93223..debae53da1f4c6814a0f2af666df36d45bd865c0 100644 (file)
@@ -640,7 +640,7 @@ ADS_STATUS ads_get_sid_token(ADS_STRUCT *ads,
                return status;
        }
 
-       token_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, 1);
+       token_sids = talloc_array(mem_ctx, struct dom_sid, 1);
        ADS_ERROR_HAVE_NO_MEMORY(token_sids);
 
        status = ADS_ERROR_NT(add_sid_to_array_unique(mem_ctx,
index 70d11239c92e6645077567c62bf472eb6c43615a..25d84e9d86095da0d65add26331398c8f88662a9 100644 (file)
@@ -519,7 +519,7 @@ NTSTATUS create_local_token(TALLOC_CTX *mem_ctx,
 
        t = session_info->security_token;
 
-       ids = TALLOC_ARRAY(talloc_tos(), struct wbcUnixId,
+       ids = talloc_array(talloc_tos(), struct wbcUnixId,
                           t->num_sids);
        if (ids == NULL) {
                return NT_STATUS_NO_MEMORY;
index ff55a671f37538aa8a8fa018a4e3af01a82458a1..386e66783415998b92de815d2a25644baca2b166 100644 (file)
@@ -693,9 +693,9 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                num_group_sids = getgroups_num_group_sids;
 
                if (num_group_sids) {
-                       group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
+                       group_sids = talloc_array(tmp_ctx, struct dom_sid, num_group_sids);
                        if (group_sids == NULL) {
-                               DEBUG(1, ("TALLOC_ARRAY failed\n"));
+                               DEBUG(1, ("talloc_array failed\n"));
                                result = NT_STATUS_NO_MEMORY;
                                goto done;
                        }
@@ -732,9 +732,9 @@ NTSTATUS create_token_from_username(TALLOC_CTX *mem_ctx, const char *username,
                }
 
                num_group_sids = 1;
-               group_sids = TALLOC_ARRAY(tmp_ctx, struct dom_sid, num_group_sids);
+               group_sids = talloc_array(tmp_ctx, struct dom_sid, num_group_sids);
                if (group_sids == NULL) {
-                       DEBUG(1, ("TALLOC_ARRAY failed\n"));
+                       DEBUG(1, ("talloc_array failed\n"));
                        result = NT_STATUS_NO_MEMORY;
                        goto done;
                }
index c252b25343806a99eab3501437398a201a56b2f2..03f87afe140031d1640f295246a9c873d55956bf 100644 (file)
@@ -124,7 +124,7 @@ do_smb_browse_reply(DNSServiceRef sdRef, DNSServiceFlags flags,
                return;
        }
 
-       bresult = TALLOC_ARRAY(talloc_tos(), struct mdns_smbsrv_result, 1);
+       bresult = talloc_array(talloc_tos(), struct mdns_smbsrv_result, 1);
        if (bresult == NULL) {
                return;
        }
index 04af27bcf3a894d0b27a842825ab978d01048980..e37c951237d98d38b2356b30490a15d90dafbd72 100644 (file)
@@ -635,7 +635,7 @@ NTSTATUS pdb_default_alias_memberships(struct pdb_methods *methods,
                return NT_STATUS_OK;
        }
 
-       *pp_alias_rids = TALLOC_ARRAY(mem_ctx, uint32, num_alias_sids);
+       *pp_alias_rids = talloc_array(mem_ctx, uint32, num_alias_sids);
        if (*pp_alias_rids == NULL)
                return NT_STATUS_NO_MEMORY;
 
index 1a6d4e152fc0aa5b3166224735c56f87df2608ab..cf8857cda541990cff878745933d5ea41b361999 100644 (file)
@@ -145,7 +145,7 @@ static bool add_mapping_entry(GROUP_MAP *map, int flag)
        len = tdb_pack(NULL, 0, "ddff",
                map->gid, map->sid_name_use, map->nt_name, map->comment);
 
-       buf = TALLOC_ARRAY(key, char, len);
+       buf = talloc_array(key, char, len);
        if (!buf) {
                TALLOC_FREE(key);
                return false;
index cb364a9aa3abc4d2d5e59169f5f0b499bab3e72a..e21977f748bfe2c0111e42d447c652252815ebca 100644 (file)
@@ -220,7 +220,6 @@ copy an IP address from one buffer to another
 
 #define TALLOC(ctx, size) talloc_named_const(ctx, size, __location__)
 #define TALLOC_P(ctx, type) (type *)talloc_named_const(ctx, sizeof(type), #type)
-#define TALLOC_ARRAY(ctx, type, count) (type *)_talloc_array(ctx, sizeof(type), count, #type)
 #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_P(ctx, type) (type *)_talloc_zero(ctx, sizeof(type), #type)
index 69ad8e4b20c7c16031d7a3013c729e159d5c4a13..e195d6f6f3c0abf1469e9d9cf22752aa18affdd2 100644 (file)
@@ -168,7 +168,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db,
 
        if (statbuf.st_size != 0) {
                result->value.dsize = statbuf.st_size;
-               result->value.dptr = TALLOC_ARRAY(result, uint8,
+               result->value.dptr = talloc_array(result, uint8,
                                                  statbuf.st_size);
                if (result->value.dptr == NULL) {
                        DEBUG(1, ("talloc failed\n"));
index c3d863f9a44fb2e6f4309cb1f05bab5aa3b33c69..f2452919af0b1440fe939fc9af8c76384084e3a6 100644 (file)
@@ -393,7 +393,7 @@ NTSTATUS g_lock_lock(struct g_lock_ctx *ctx, const char *name,
                 * sys_poll and in the clustering case we might have to add
                 * the ctdb fd. This avoids the realloc then.
                 */
-               pollfds = TALLOC_ARRAY(talloc_tos(), struct pollfd, 2);
+               pollfds = talloc_array(talloc_tos(), struct pollfd, 2);
                if (pollfds == NULL) {
                        status = NT_STATUS_NO_MEMORY;
                        break;
index 28619a0e44b01ed56fc2c841d0a7cb79d0d1bd0e..f1182100c7056eb6d0bc864d666290c4751225a2 100644 (file)
@@ -3572,7 +3572,7 @@ WERROR NetUserGetLocalGroups_r(struct libnetapi_ctx *ctx,
        }
 
        sid_array.num_sids = rid_array->count + 1;
-       sid_array.sids = TALLOC_ARRAY(ctx, struct lsa_SidPtr, sid_array.num_sids);
+       sid_array.sids = talloc_array(ctx, struct lsa_SidPtr, sid_array.num_sids);
        if (!sid_array.sids) {
                werr = WERR_NOMEM;
                goto done;
index c2494e2293a1501783c8a1e5c6f6713a8e05c20c..ed971a97a6c834fc6e48dc075e768d30009c1540 100644 (file)
@@ -463,7 +463,7 @@ bool parse_usershare_acl(TALLOC_CTX *ctx, const char *acl_str, struct security_d
        /* Add the number of ',' characters to get the number of aces. */
        num_aces += count_chars(pacl,',');
 
-       ace_list = TALLOC_ARRAY(ctx, struct security_ace, num_aces);
+       ace_list = talloc_array(ctx, struct security_ace, num_aces);
        if (!ace_list) {
                return False;
        }
index fe383663d76e03fd9d13f0e00653de00c7afdd40..1632cd2feb845cd06e8fc1e0e6340fe70a8b0eaf 100644 (file)
@@ -239,7 +239,7 @@ ATTRIB_MAP_ENTRY sidmap_attr_list[] = {
                i++;
        i++;
 
-       names = TALLOC_ARRAY( mem_ctx, const char*, i );
+       names = talloc_array( mem_ctx, const char*, i );
        if ( !names ) {
                DEBUG(0,("get_attr_list: out of memory\n"));
                return NULL;
index a6f7de0af50f8d10ddb483e3c993a51a20475713..342a5ffaed220cd51f3360eb109d59604fd16fd2 100644 (file)
@@ -1382,7 +1382,7 @@ static char **extract_args(TALLOC_CTX *mem_ctx, const char *command)
 
        TALLOC_FREE(trunc_cmd);
 
-       if (!(argl = TALLOC_ARRAY(mem_ctx, char *, argcl + 1))) {
+       if (!(argl = talloc_array(mem_ctx, char *, argcl + 1))) {
                goto nomem;
        }
 
index 6fe8f67448fb2567418b9f4b02176df68819fe36..a348b389e8659c84fb89672cbf2eebbede5f2ba7 100644 (file)
@@ -624,7 +624,7 @@ bool str_list_substitute(char **list, const char *pattern, const char *insert)
                        t = *list;
                        d = p -t;
                        if (ld) {
-                               t = TALLOC_ARRAY(ctx, char, ls +ld +1);
+                               t = talloc_array(ctx, char, ls +ld +1);
                                if (!t) {
                                        DEBUG(0,("str_list_substitute: "
                                                "Unable to allocate memory"));
@@ -926,7 +926,7 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
                if (*bufsize == 0)
                        *bufsize = 128;
 
-               *string = TALLOC_ARRAY(mem_ctx, char, *bufsize);
+               *string = talloc_array(mem_ctx, char, *bufsize);
                if (*string == NULL)
                        goto error;
        }
@@ -1229,7 +1229,7 @@ char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string,
        if (!string || !*string)
                return NULL;
 
-       list = TALLOC_ARRAY(mem_ctx, char *, S_LIST_ABS+1);
+       list = talloc_array(mem_ctx, char *, S_LIST_ABS+1);
        if (list == NULL) {
                return NULL;
        }
index 3fa1485d45291073f73b97feb201cb0d81f1978c..b458ebe8472465181cdfb15c423c71aebd6537eb 100644 (file)
@@ -237,8 +237,8 @@ bool winbind_lookup_rids(TALLOC_CTX *mem_ctx,
        }       
 
        *domain_name = talloc_strdup(mem_ctx, dom_name);
-       *names       = TALLOC_ARRAY(mem_ctx, const char*, num_rids);
-       *types       = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
+       *names       = talloc_array(mem_ctx, const char*, num_rids);
+       *types       = talloc_array(mem_ctx, enum lsa_SidType, num_rids);
 
        for(i=0; i<num_rids; i++) {
                (*names)[i] = talloc_strdup(*names, namelist[i]);
@@ -284,7 +284,7 @@ bool winbind_get_groups(TALLOC_CTX * mem_ctx, const char *account, uint32_t *num
        if (ret != WBC_ERR_SUCCESS)
                return false;
 
-       *_groups = TALLOC_ARRAY(mem_ctx, gid_t, ngroups);
+       *_groups = talloc_array(mem_ctx, gid_t, ngroups);
        if (*_groups == NULL) {
            wbcFreeMemory(group_list);
            return false;
@@ -313,7 +313,7 @@ bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
 
        memcpy(&domain_sid, dom_sid, sizeof(*dom_sid));
 
-       sid_list = TALLOC_ARRAY(mem_ctx, struct wbcDomainSid, num_members);
+       sid_list = talloc_array(mem_ctx, struct wbcDomainSid, num_members);
 
        for (i=0; i < num_members; i++) {
            memcpy(&sid_list[i], &members[i], sizeof(sid_list[i]));
@@ -328,7 +328,7 @@ bool winbind_get_sid_aliases(TALLOC_CTX *mem_ctx,
                return false;
        }
 
-       *pp_alias_rids = TALLOC_ARRAY(mem_ctx, uint32_t, num_rids);
+       *pp_alias_rids = talloc_array(mem_ctx, uint32_t, num_rids);
        if (*pp_alias_rids == NULL) {
                wbcFreeMemory(rids);
                return false;
index 08180a65c0ca21b4c1dfda7329403cd3d8f1c169..c1332849bff6bc5988327b844c1880cf87acea60 100644 (file)
@@ -328,7 +328,7 @@ static NTSTATUS dns_send_req( TALLOC_CTX *ctx, const char *name, int q_type,
                buf_len = resp_len * sizeof(uint8);
 
                if (buf_len) {
-                       if ((buffer = TALLOC_ARRAY(ctx, uint8, buf_len))
+                       if ((buffer = talloc_array(ctx, uint8, buf_len))
                                        == NULL ) {
                                DEBUG(0,("ads_dns_lookup_srv: "
                                        "talloc() failed!\n"));
@@ -534,7 +534,7 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
                                /* allocate new memory */
 
                                if (dcs[i].num_ips == 0) {
-                                       if ((dcs[i].ss_s = TALLOC_ARRAY(dcs,
+                                       if ((dcs[i].ss_s = talloc_array(dcs,
                                                struct sockaddr_storage, 1 ))
                                                        == NULL ) {
                                                return NT_STATUS_NO_MEMORY;
@@ -638,7 +638,7 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
                answer_count));
 
        if (answer_count) {
-               if ((nsarray = TALLOC_ARRAY(ctx, struct dns_rr_ns,
+               if ((nsarray = talloc_array(ctx, struct dns_rr_ns,
                                                answer_count)) == NULL ) {
                        DEBUG(0,("ads_dns_lookup_ns: "
                                "talloc() failure for %d char*'s\n",
index 48a832e1a902c5cd9967a9576d846f9296b1ac8e..a41686a495da9ecb4bc7e8004571b2377b189039 100644 (file)
@@ -964,7 +964,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
                        if (S_ISLNK(sbuf.st_ex_mode) && sbuf.st_ex_size) {
                                int lret;
                                size_t alloc_size = sbuf.st_ex_size + 1;
-                               char *linkpath = TALLOC_ARRAY(talloc_tos(), char,
+                               char *linkpath = talloc_array(talloc_tos(), char,
                                                alloc_size);
                                if (!linkpath) {
                                        goto done;
index f39e6ede5c4ce067951f83e0725afb961baaf897..743bf42b1e4e79612f891ce01edad3341f7cc52c 100644 (file)
@@ -2433,7 +2433,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
 
        *num_values = ldap_count_values(values);
 
-       ret = TALLOC_ARRAY(mem_ctx, char *, *num_values + 1);
+       ret = talloc_array(mem_ctx, char *, *num_values + 1);
        if (!ret) {
                ldap_value_free(values);
                return NULL;
@@ -2669,7 +2669,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
                /* nop */ ;
 
        if (i) {
-               (*sids) = TALLOC_ARRAY(mem_ctx, struct dom_sid, i);
+               (*sids) = talloc_array(mem_ctx, struct dom_sid, i);
                if (!(*sids)) {
                        ldap_value_free_len(values);
                        return 0;
index 3e3ea258405ad1dad0015355adaf1aea087397c7..8ff9f9bdc9d3f84f217a55aad4f3db2733e04805 100644 (file)
@@ -199,7 +199,7 @@ static bool map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
        };
 
        if (num_vals) {
-               str_values = TALLOC_ARRAY(ctx, char *, num_vals + 1);
+               str_values = talloc_array(ctx, char *, num_vals + 1);
                if (!str_values) {
                        return False;
                }
index 51aac14906c9e7697e0df22333950444d77173da..df13b08f4a2ca44db4ef6b23da5c9dc2eb3f2d38 100644 (file)
@@ -76,11 +76,11 @@ static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads,
                goto out;
        }
 
-       if (((*names) = TALLOC_ARRAY(mem_ctx, char *, *count)) == NULL) {
+       if (((*names) = talloc_array(mem_ctx, char *, *count)) == NULL) {
                status = ADS_ERROR(LDAP_NO_MEMORY);
                goto out;
        }
-       if (((*OIDs_out) = TALLOC_ARRAY(mem_ctx, char *, *count)) == NULL) {
+       if (((*OIDs_out) = talloc_array(mem_ctx, char *, *count)) == NULL) {
                status = ADS_ERROR(LDAP_NO_MEMORY);
                goto out;
        }
index ab77abdd16bbc322b91accd3c93415d28f7060a0..2f1c1b8e0a576c889f6482bb63ea769d40c1454d 100644 (file)
@@ -242,7 +242,7 @@ ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
        *num_strings = 0;
        *strings = NULL;
 
-       attrs = TALLOC_ARRAY(mem_ctx, const char *, 3);
+       attrs = talloc_array(mem_ctx, const char *, 3);
        ADS_ERROR_HAVE_NO_MEMORY(attrs);
 
        attrs[0] = talloc_strdup(mem_ctx, range_attr);
index 65085cd96eb442284c7562e73f6a3d40637914ca..6f3ed642260734eced4fd0fcf41636888dbc4a49 100644 (file)
@@ -276,7 +276,7 @@ static NTSTATUS parse_object(TALLOC_CTX *mem_ctx,
                if (attr->attid == DRSUAPI_ATTID_servicePrincipalName) {
                        uint32_t count;
                        num_spns = attr->value_ctr.num_values;
-                       spn = TALLOC_ARRAY(mem_ctx, char *, num_spns);
+                       spn = talloc_array(mem_ctx, char *, num_spns);
                        for (count = 0; count < num_spns; count++) {
                                blob = attr->value_ctr.values[count].blob;
                                pull_string_talloc(spn, NULL, 0,
index 8b76e8f5d8b8c7190cf5edcb4d1d0cec90ba1146..ad5685361bcba550a592d349dfff415fc1d2d920 100644 (file)
@@ -3998,7 +3998,7 @@ static bool parse_ea_blob(TALLOC_CTX *ctx, const uint8_t *rdata,
                return true;
        }
 
-       ea_list = TALLOC_ARRAY(ctx, struct ea_struct, num_eas);
+       ea_list = talloc_array(ctx, struct ea_struct, num_eas);
        if (!ea_list) {
                return false;
        }
index 83cc81549a96d6fb4367dc8c3490215864ad8590..9eec97fbeb1f6bb376c87c5f54ff9ca1cce5acdd 100644 (file)
@@ -452,7 +452,7 @@ static NTSTATUS cli_list_old_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
 
        num_received = talloc_array_length(state->dirlist) / DIR_STRUCT_SIZE;
 
-       finfo = TALLOC_ARRAY(mem_ctx, struct file_info, num_received);
+       finfo = talloc_array(mem_ctx, struct file_info, num_received);
        if (finfo == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -573,7 +573,7 @@ static struct tevent_req *cli_list_trans_send(TALLOC_CTX *mem_ctx,
        state->setup[0] = TRANSACT2_FINDFIRST;
 
        nlen = 2*(strlen(mask)+1);
-       state->param = TALLOC_ARRAY(state, uint8_t, 12+nlen+2);
+       state->param = talloc_array(state, uint8_t, 12+nlen+2);
        if (tevent_req_nomem(state->param, req)) {
                return tevent_req_post(req, ev);
        }
index 008db0b65a2c0491d3c8c3294a2c9d4e34409962..e5ff1abc18bdf2c1a5128661398f7bc2338cd67c 100644 (file)
@@ -1023,7 +1023,7 @@ static bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
                 * convert_string_talloc??
                 */
 
-               tmp_buf = TALLOC_ARRAY(streams, uint8_t, nlen+2);
+               tmp_buf = talloc_array(streams, uint8_t, nlen+2);
                if (tmp_buf == NULL) {
                        goto fail;
                }
index fc6c9ffc0053f5fa545063a83a219781ce0e6f7d..223309f75661000f82ca808860ba785105b254d9 100644 (file)
@@ -704,7 +704,7 @@ NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
         * 3 bytes prefix
         */
 
-       bytes = TALLOC_ARRAY(talloc_tos(), uint8_t, 3);
+       bytes = talloc_array(talloc_tos(), uint8_t, 3);
        if (bytes == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
index 44dafa7e43f2537bca7affe6356ffe4339b58b6f..99a358f81fc1b9cd44edc32aff98554e4c7d4913 100644 (file)
@@ -148,7 +148,7 @@ static NTSTATUS cli_trans_pull_blob(TALLOC_CTX *mem_ctx,
                        return NT_STATUS_INVALID_NETWORK_RESPONSE;
                }
                blob->total = total;
-               blob->data = TALLOC_ARRAY(mem_ctx, uint8_t, total);
+               blob->data = talloc_array(mem_ctx, uint8_t, total);
                if (blob->data == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
index 64a956d9ee4ee25e2dbb8a6dd984dbf61a0a024a..1dcf2dd51672cd9c9b15f78938bf37a5b929696b 100644 (file)
@@ -88,7 +88,7 @@ urldecode_talloc(TALLOC_CTX *ctx, char **pp_dest, const char *src)
                newlen++;
        }
 
-       dest = TALLOC_ARRAY(ctx, char, newlen);
+       dest = talloc_array(ctx, char, newlen);
        if (!dest) {
                return err_count;
        }
index eec42ff6226b967603b52247fa5df35098d75de5..f5f4a7c1dcb3eaed93d81000ebd38dfdb26afeb1 100644 (file)
@@ -237,7 +237,7 @@ static struct node_status *parse_node_status(TALLOC_CTX *mem_ctx, char *p,
        if (*num_names == 0)
                return NULL;
 
-       ret = TALLOC_ARRAY(mem_ctx, struct node_status,*num_names);
+       ret = talloc_array(mem_ctx, struct node_status,*num_names);
        if (!ret)
                return NULL;
 
@@ -1117,7 +1117,7 @@ static int remove_duplicate_addrs2(struct ip_service *iplist, int count )
 static bool prioritize_ipv4_list(struct ip_service *iplist, int count)
 {
        TALLOC_CTX *frame = talloc_stackframe();
-       struct ip_service *iplist_new = TALLOC_ARRAY(frame, struct ip_service, count);
+       struct ip_service *iplist_new = talloc_array(frame, struct ip_service, count);
        int i, j;
 
        if (iplist_new == NULL) {
@@ -2514,7 +2514,7 @@ NTSTATUS resolve_name_list(TALLOC_CTX *ctx,
                return NT_STATUS_BAD_NETWORK_NAME;
        }
 
-       *return_ss_arr = TALLOC_ARRAY(ctx,
+       *return_ss_arr = talloc_array(ctx,
                                struct sockaddr_storage,
                                num_entries);
        if (!(*return_ss_arr)) {
index a4561f50d83c5f849512b685f039c644ad361bb4..55412ec8b2aa8c702db98b739d6e6fe2f64b276c 100644 (file)
@@ -616,7 +616,7 @@ static int parse_delete_tokens_list(struct share_mode_lock *lck,
                        }
 
                        pdtl->delete_token->ngroups = token_len / sizeof(gid_t);
-                       pdtl->delete_token->groups = TALLOC_ARRAY(pdtl->delete_token, gid_t,
+                       pdtl->delete_token->groups = talloc_array(pdtl->delete_token, gid_t,
                                                pdtl->delete_token->ngroups);
                        if (pdtl->delete_token->groups == NULL) {
                                DEBUG(0,("parse_delete_tokens_list: talloc failed"));
@@ -782,7 +782,7 @@ static TDB_DATA unparse_share_modes(const struct share_mode_lock *lck)
                sp_len + 1 +
                bn_len + 1 +
                sn_len + 1;
-       result.dptr = TALLOC_ARRAY(lck, uint8, result.dsize);
+       result.dptr = talloc_array(lck, uint8, result.dsize);
 
        if (result.dptr == NULL) {
                smb_panic("talloc failed");
@@ -1082,7 +1082,7 @@ bool rename_share_filename(struct messaging_context *msg_ctx,
            sn_len + 1;
 
        /* Set up the name changed message. */
-       frm = TALLOC_ARRAY(lck, char, msg_len);
+       frm = talloc_array(lck, char, msg_len);
        if (!frm) {
                return False;
        }
index 3f1aa6da571ec68c6a5e2234e5accb933f5528df..2e590413f86c7e6fabae1e2b9f7a28220f0358dd 100644 (file)
@@ -558,7 +558,7 @@ static void add_fd_to_close_entry(files_struct *fsp)
 
        SMB_ASSERT(rec != NULL);
 
-       new_data = TALLOC_ARRAY(
+       new_data = talloc_array(
                rec, uint8_t, rec->value.dsize + sizeof(fsp->fh->fd));
 
        SMB_ASSERT(new_data != NULL);
index 4fdfdd997c05596a0f7613bffe0395c8ba553a54..658f3be179914b8ba2e7f25e8355348b5b62c395 100644 (file)
@@ -605,7 +605,7 @@ static size_t afs_to_nt_acl_common(struct afs_acl *afs_acl,
        gid_to_sid(&group_sid, psbuf->st_ex_gid);
 
        if (afs_acl->num_aces) {
-               nt_ace_list = TALLOC_ARRAY(mem_ctx, struct security_ace, afs_acl->num_aces);
+               nt_ace_list = talloc_array(mem_ctx, struct security_ace, afs_acl->num_aces);
 
                if (nt_ace_list == NULL)
                        return 0;
index 7aab6c3973b647c70275e6ad135f67af59e6ff1e..15bebf6fea020f147fc49ff2494a828be235b4d0 100644 (file)
@@ -75,7 +75,7 @@ static SMB_STRUCT_DIRENT *cap_readdir(vfs_handle_struct *handle,
        }
        DEBUG(3,("cap: cap_readdir: %s\n", newname));
        newnamelen = strlen(newname)+1;
-       newdirent = (SMB_STRUCT_DIRENT *)TALLOC_ARRAY(talloc_tos(),
+       newdirent = (SMB_STRUCT_DIRENT *)talloc_array(talloc_tos(),
                        char,
                        sizeof(SMB_STRUCT_DIRENT)+
                                newnamelen);
@@ -663,7 +663,7 @@ static char *capencode(TALLOC_CTX *ctx, const char *from)
        }
        len++;
 
-       to = TALLOC_ARRAY(ctx, char, len);
+       to = talloc_array(ctx, char, len);
        if (!to) {
                return NULL;
        }
@@ -704,7 +704,7 @@ static char *capdecode(TALLOC_CTX *ctx, const char *from)
        }
        len++;
 
-       to = TALLOC_ARRAY(ctx, char, len);
+       to = talloc_array(ctx, char, len);
        if (!to) {
                return NULL;
        }
index f1f82d243ee05fd8be0a4ed114611f3009b7beed..eb7c6fed6b5e17e6b58417d4a20de0fcc3fb7d42 100644 (file)
@@ -178,7 +178,7 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
 {
        TALLOC_CTX *ctx = talloc_tos();
        int result;
-       char *target = TALLOC_ARRAY(ctx, char, PATH_MAX+1);
+       char *target = talloc_array(ctx, char, PATH_MAX+1);
        size_t len;
 
        if (!target) {
index b29a4c4351d0d88dd36041b620dda031a16fdfee..3d7f6c1b03844b9b5ce61d78b33c01a0db8b7d51 100644 (file)
@@ -193,7 +193,7 @@ static bool preopen_helper(int fd, size_t to_read)
        char *namebuf;
        void *readbuf;
 
-       namebuf = TALLOC_ARRAY(NULL, char, 1024);
+       namebuf = talloc_array(NULL, char, 1024);
        if (namebuf == NULL) {
                return false;
        }
@@ -261,7 +261,7 @@ static NTSTATUS preopen_init_helpers(TALLOC_CTX *mem_ctx, size_t to_read,
        }
 
        result->num_helpers = num_helpers;
-       result->helpers = TALLOC_ARRAY(result, struct preopen_helper,
+       result->helpers = talloc_array(result, struct preopen_helper,
                                       num_helpers);
        if (result->helpers == NULL) {
                TALLOC_FREE(result);
index 549eb304bdd0fde7f4e02008bfe2a8ea4fcde5dc..a47d875b646ae30808355df943f5fc395f808600 100644 (file)
@@ -632,7 +632,7 @@ static SMB_STRUCT_DIRENT *scannedonly_readdir(vfs_handle_struct *handle,
                ctx,"%s %s",result->d_name,
                STRUCTSCANO(handle->data)->scanning_message);
        namelen = strlen(notify_name);
-       newdirent = (SMB_STRUCT_DIRENT *)TALLOC_ARRAY(
+       newdirent = (SMB_STRUCT_DIRENT *)talloc_array(
                ctx, char, sizeof(SMB_STRUCT_DIRENT) + namelen + 1);
        if (!newdirent) {
                return NULL;
index 12e3ab17e3295d1c17d56f4945fdb67438759fbd..6ec25c45c1cfb5b4b0cbd80b1b59291225379b7d 100644 (file)
@@ -1714,7 +1714,7 @@ static bool create_listen_pollfds(struct pollfd **pfds,
                return true;
        }
 
-       attrs = TALLOC_ARRAY(NULL, struct socket_attributes, count);
+       attrs = talloc_array(NULL, struct socket_attributes, count);
        if (fds == NULL) {
                DEBUG(1, ("create_listen_pollfds: malloc fail for attrs. "
                          "size %d\n", count));
index 5cf391f11c7376c87d9d32413039f64bf63c82ab..bb193f3cddedc39b70a4afbdd5dc6adc73742a29 100644 (file)
@@ -483,7 +483,7 @@ static bool lookup_rids(TALLOC_CTX *mem_ctx, const struct dom_sid *domain_sid,
 
        if (num_rids) {
                *names = TALLOC_ZERO_ARRAY(mem_ctx, const char *, num_rids);
-               *types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
+               *types = talloc_array(mem_ctx, enum lsa_SidType, num_rids);
 
                if ((*names == NULL) || (*types == NULL)) {
                        return false;
@@ -750,7 +750,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
        }
 
        if (num_sids) {
-               name_infos = TALLOC_ARRAY(mem_ctx, struct lsa_name_info, num_sids);
+               name_infos = talloc_array(mem_ctx, struct lsa_name_info, num_sids);
                if (name_infos == NULL) {
                        result = NT_STATUS_NO_MEMORY;
                        goto fail;
@@ -896,7 +896,7 @@ NTSTATUS lookup_sids(TALLOC_CTX *mem_ctx, int num_sids,
                }
 
                if (dom->num_idxs) {
-                       if (!(rids = TALLOC_ARRAY(tmp_ctx, uint32, dom->num_idxs))) {
+                       if (!(rids = talloc_array(tmp_ctx, uint32, dom->num_idxs))) {
                                result = NT_STATUS_NO_MEMORY;
                                goto fail;
                        }
@@ -1404,7 +1404,7 @@ bool sids_to_unix_ids(const struct dom_sid *sids, uint32_t num_sids,
        wbcErr err;
        bool ret = false;
 
-       wbc_sids = TALLOC_ARRAY(talloc_tos(), struct wbcDomainSid, num_sids);
+       wbc_sids = talloc_array(talloc_tos(), struct wbcDomainSid, num_sids);
        if (wbc_sids == NULL) {
                return false;
        }
@@ -1455,7 +1455,7 @@ bool sids_to_unix_ids(const struct dom_sid *sids, uint32_t num_sids,
        if (num_not_cached == 0) {
                goto done;
        }
-       wbc_ids = TALLOC_ARRAY(talloc_tos(), struct wbcUnixId, num_not_cached);
+       wbc_ids = talloc_array(talloc_tos(), struct wbcUnixId, num_not_cached);
        if (wbc_ids == NULL) {
                goto fail;
        }
index 36d5aaa01a7586739a7752a3f7846e07b8684871..d6f791053d45190aeffa52d87258f07031858718 100644 (file)
@@ -1570,7 +1570,7 @@ static NTSTATUS pdb_default_enum_group_memberships(struct pdb_methods *methods,
                smb_panic("primary group missing");
        }
 
-       *pp_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, *p_num_groups);
+       *pp_sids = talloc_array(mem_ctx, struct dom_sid, *p_num_groups);
 
        if (*pp_sids == NULL) {
                TALLOC_FREE(*pp_gids);
index 5f89be7a29fc78c0361ad50115b99b34862e60f3..556283dc6b373cd1c4d93b05635935643627e493 100644 (file)
@@ -636,7 +636,7 @@ static NTSTATUS ipasam_enum_trusted_domains(struct pdb_methods *methods,
        }
 
        *num_domains = 0;
-       if (!(*domains = TALLOC_ARRAY(mem_ctx, struct pdb_trusted_domain *, 1))) {
+       if (!(*domains = talloc_array(mem_ctx, struct pdb_trusted_domain *, 1))) {
                DEBUG(1, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
        }
@@ -684,7 +684,7 @@ static NTSTATUS ipasam_enum_trusteddoms(struct pdb_methods *methods,
                return NT_STATUS_OK;
        }
 
-       if (!(*domains = TALLOC_ARRAY(mem_ctx, struct trustdom_info *,
+       if (!(*domains = talloc_array(mem_ctx, struct trustdom_info *,
                                      *num_domains))) {
                DEBUG(1, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
index c21b54f74de1944a34c6f5f202cd7641d8a8e9e7..8167e3799eefee1a0cfc83d33c11f36f8a56f0ac 100644 (file)
@@ -208,7 +208,7 @@ static NTSTATUS ldapsam_get_seq_num(struct pdb_methods *my_methods, time_t *seq_
        if (mem_ctx == NULL)
                return NT_STATUS_NO_MEMORY;
 
-       if ((attrs = TALLOC_ARRAY(mem_ctx, const char *, 2)) == NULL) {
+       if ((attrs = talloc_array(mem_ctx, const char *, 2)) == NULL) {
                ntstatus = NT_STATUS_NO_MEMORY;
                goto done;
        }
@@ -887,7 +887,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
        if (pwHistLen > 0){
                uint8 *pwhist = NULL;
                int i;
-               char *history_string = TALLOC_ARRAY(ctx, char,
+               char *history_string = talloc_array(ctx, char,
                                                MAX_PW_HISTORY_LEN*64);
 
                if (!history_string) {
@@ -896,7 +896,7 @@ static bool init_sam_from_ldap(struct ldapsam_privates *ldap_state,
 
                pwHistLen = MIN(pwHistLen, MAX_PW_HISTORY_LEN);
 
-               pwhist = TALLOC_ARRAY(ctx, uint8,
+               pwhist = talloc_array(ctx, uint8,
                                      pwHistLen * PW_HISTORY_ENTRY_LEN);
                if (pwhist == NULL) {
                        DEBUG(0, ("init_sam_from_ldap: talloc failed!\n"));
@@ -4340,7 +4340,7 @@ static const char **talloc_attrs(TALLOC_CTX *mem_ctx, ...)
                num += 1;
        va_end(ap);
 
-       if ((result = TALLOC_ARRAY(mem_ctx, const char *, num+1)) == NULL) {
+       if ((result = talloc_array(mem_ctx, const char *, num+1)) == NULL) {
                return NULL;
        }
 
@@ -6356,7 +6356,7 @@ static NTSTATUS ldapsam_enum_trusteddoms(struct pdb_methods *methods,
        }
 
        *num_domains = 0;
-       if (!(*domains = TALLOC_ARRAY(mem_ctx, struct trustdom_info *, 1))) {
+       if (!(*domains = talloc_array(mem_ctx, struct trustdom_info *, 1))) {
                DEBUG(1, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
        }
index 64529c7896116b59de81676a78024bcdd315eb47..91adc8108b31c2f692c8f111491780f247c71c7a 100644 (file)
@@ -112,7 +112,7 @@ static NTSTATUS pdb_wbc_sam_enum_group_memberships(struct pdb_methods *methods,
                smb_panic("primary group missing");
        }
 
-       *pp_sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, *p_num_groups);
+       *pp_sids = talloc_array(mem_ctx, struct dom_sid, *p_num_groups);
 
        if (*pp_sids == NULL) {
                TALLOC_FREE(*pp_gids);
index 8d544f1240207df04508600ed3cd5e8ad3b7c05d..a1337eac9d377514ca241a62238df1ffdcceb24f 100644 (file)
@@ -459,7 +459,7 @@ NTSTATUS secrets_trusted_domains(TALLOC_CTX *mem_ctx, uint32 *num_domains,
         * exists
         */
 
-       if (!(state.domains = TALLOC_ARRAY(
+       if (!(state.domains = talloc_array(
                      mem_ctx, struct trustdom_info *, 1))) {
                return NT_STATUS_NO_MEMORY;
        }
index 0c7236ef3b9c563d6f0f63573e0470ade6d3b373..9fd73e87071c9c0a168831ef751b2da2d2362a60 100644 (file)
@@ -650,7 +650,7 @@ static bool print_notify_pid_list(const char *printername, TALLOC_CTX *mem_ctx,
        num_pids = data.dsize / 8;
 
        if (num_pids) {
-               if ((pid_list = TALLOC_ARRAY(mem_ctx, pid_t, num_pids)) == NULL) {
+               if ((pid_list = talloc_array(mem_ctx, pid_t, num_pids)) == NULL) {
                        ret = False;
                        goto done;
                }
index 566ab0bc6b8e2224ae7424117bef9381b57ebbe4..05f3a5a0ab7c1f014da1e563be08bb1d34c2d986 100644 (file)
@@ -1820,7 +1820,7 @@ static bool regdb_store_values_internal(struct db_context *db, const char *key,
                goto done;
        }
 
-       data.dptr = TALLOC_ARRAY(ctx, uint8, len);
+       data.dptr = talloc_array(ctx, uint8, len);
        data.dsize = len;
 
        len = regdb_pack_values(values, data.dptr, data.dsize);
index 8715ab567301150aed491eb66a2f70289d8fe6a4..925ff8775a647f4fe9607e4313fc9eb51ce5fc81 100644 (file)
@@ -1926,7 +1926,7 @@ static int hashrec_cmp( REGF_HASH_REC *h1, REGF_HASH_REC *h2 )
                nk->values_off = prs_offset( &vlist_hbin->ps ) + vlist_hbin->first_hbin_off - HBIN_HDR_SIZE;
        
                if (nk->num_values) {
-                       if ( !(nk->values = TALLOC_ARRAY( file->mem_ctx, REGF_VK_REC, nk->num_values )) )
+                       if ( !(nk->values = talloc_array( file->mem_ctx, REGF_VK_REC, nk->num_values )) )
                                return NULL;
                } else {
                        nk->values = NULL;
index e59957118197d86a8ee5027663a509ab64412c6e..66192bdf54f9ec8c8c51c121518731fb7e0aea33 100644 (file)
@@ -187,7 +187,7 @@ static NTSTATUS dcerpc_lsa_lookup_sids_noalloc(struct dcerpc_binding_handle *h,
        ZERO_STRUCT(lsa_names);
 
        sid_array.num_sids = num_sids;
-       sid_array.sids = TALLOC_ARRAY(mem_ctx, struct lsa_SidPtr, num_sids);
+       sid_array.sids = talloc_array(mem_ctx, struct lsa_SidPtr, num_sids);
        if (sid_array.sids == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -354,19 +354,19 @@ static NTSTATUS dcerpc_lsa_lookup_sids_generic(struct dcerpc_binding_handle *h,
        bool have_unmapped = false;
 
        if (num_sids) {
-               if (!(domains = TALLOC_ARRAY(mem_ctx, char *, num_sids))) {
+               if (!(domains = talloc_array(mem_ctx, char *, num_sids))) {
                        DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n"));
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
                }
 
-               if (!(names = TALLOC_ARRAY(mem_ctx, char *, num_sids))) {
+               if (!(names = talloc_array(mem_ctx, char *, num_sids))) {
                        DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n"));
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
                }
 
-               if (!(types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_sids))) {
+               if (!(types = talloc_array(mem_ctx, enum lsa_SidType, num_sids))) {
                        DEBUG(0, ("rpccli_lsa_lookup_sids(): out of memory\n"));
                        status = NT_STATUS_NO_MEMORY;
                        goto fail;
@@ -589,7 +589,7 @@ static NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
        ZERO_STRUCT(sid_array);
        ZERO_STRUCT(sid_array3);
 
-       lsa_names = TALLOC_ARRAY(mem_ctx, struct lsa_String, num_names);
+       lsa_names = talloc_array(mem_ctx, struct lsa_String, num_names);
        if (lsa_names == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -639,20 +639,20 @@ static NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
        }
 
        if (num_names) {
-               if (!((*sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_names)))) {
+               if (!((*sids = talloc_array(mem_ctx, struct dom_sid, num_names)))) {
                        DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
                        *presult = NT_STATUS_NO_MEMORY;
                        goto done;
                }
 
-               if (!((*types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_names)))) {
+               if (!((*types = talloc_array(mem_ctx, enum lsa_SidType, num_names)))) {
                        DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
                        *presult = NT_STATUS_NO_MEMORY;
                        goto done;
                }
 
                if (dom_names != NULL) {
-                       *dom_names = TALLOC_ARRAY(mem_ctx, const char *, num_names);
+                       *dom_names = talloc_array(mem_ctx, const char *, num_names);
                        if (*dom_names == NULL) {
                                DEBUG(0, ("cli_lsa_lookup_sids(): out of memory\n"));
                                *presult = NT_STATUS_NO_MEMORY;
index dcdf1f5a24445a4282cdbd904bec2b5ac4968fb5..76d2cf164b0aa5a7d3c3a4b85bdd031bff23505d 100644 (file)
@@ -606,7 +606,7 @@ static void cli_api_pipe_write_done(struct tevent_req *subreq)
                return;
        }
 
-       state->rdata = TALLOC_ARRAY(state, uint8_t, RPC_HEADER_LEN);
+       state->rdata = talloc_array(state, uint8_t, RPC_HEADER_LEN);
        if (tevent_req_nomem(state->rdata, req)) {
                return;
        }
@@ -2565,7 +2565,7 @@ static NTSTATUS rpc_pipe_get_tcp_port(const char *host,
 
        /* allocate further parameters for the epm_Map call */
 
-       res_towers = TALLOC_ARRAY(tmp_ctx, struct epm_twr_t, max_towers);
+       res_towers = talloc_array(tmp_ctx, struct epm_twr_t, max_towers);
        if (res_towers == NULL) {
                status = NT_STATUS_NO_MEMORY;
                goto done;
index 6ca35a5dcc97023071956c5df8098f2b0eee564d..723760d601e121d59896026b1d9914c8ef9b06a0 100644 (file)
@@ -88,7 +88,7 @@ WERROR _dfs_Add(struct pipes_struct *p, struct dfs_Add *r)
                return WERR_NOMEM;
        }
 
-       jn->referral_list = TALLOC_ARRAY(ctx, struct referral, jn->referral_count);
+       jn->referral_list = talloc_array(ctx, struct referral, jn->referral_count);
        if(jn->referral_list == NULL) {
                DEBUG(0,("init_reply_dfs_add: talloc failed for referral list!\n"));
                return WERR_DFS_INTERNAL_ERROR;
@@ -233,7 +233,7 @@ static bool init_reply_dfs_info_3(TALLOC_CTX *mem_ctx, struct junction_map* j, s
 
        /* also enumerate the stores */
        if (j->referral_count) {
-               dfs3->stores = TALLOC_ARRAY(mem_ctx, struct dfs_StorageInfo, j->referral_count);
+               dfs3->stores = talloc_array(mem_ctx, struct dfs_StorageInfo, j->referral_count);
                if (!dfs3->stores)
                        return False;
                memset(dfs3->stores, '\0', j->referral_count * sizeof(struct dfs_StorageInfo));
@@ -295,7 +295,7 @@ WERROR _dfs_Enum(struct pipes_struct *p, struct dfs_Enum *r)
        switch (r->in.level) {
        case 1:
                if (num_jn) {
-                       if ((r->out.info->e.info1->s = TALLOC_ARRAY(ctx, struct dfs_Info1, num_jn)) == NULL) {
+                       if ((r->out.info->e.info1->s = talloc_array(ctx, struct dfs_Info1, num_jn)) == NULL) {
                                return WERR_NOMEM;
                        }
                } else {
@@ -305,7 +305,7 @@ WERROR _dfs_Enum(struct pipes_struct *p, struct dfs_Enum *r)
                break;
        case 2:
                if (num_jn) {
-                       if ((r->out.info->e.info2->s = TALLOC_ARRAY(ctx, struct dfs_Info2, num_jn)) == NULL) {
+                       if ((r->out.info->e.info2->s = talloc_array(ctx, struct dfs_Info2, num_jn)) == NULL) {
                                return WERR_NOMEM;
                        }
                } else {
@@ -315,7 +315,7 @@ WERROR _dfs_Enum(struct pipes_struct *p, struct dfs_Enum *r)
                break;
        case 3:
                if (num_jn) {
-                       if ((r->out.info->e.info3->s = TALLOC_ARRAY(ctx, struct dfs_Info3, num_jn)) == NULL) {
+                       if ((r->out.info->e.info3->s = talloc_array(ctx, struct dfs_Info3, num_jn)) == NULL) {
                                return WERR_NOMEM;
                        }
                } else {
index c7a9e1a97daccc9223804828710f2333bc0678cb..7c8ae19b82b15dc9075ba291d398ba9158616706 100644 (file)
@@ -48,7 +48,7 @@ void _echo_EchoData(struct pipes_struct *p, struct echo_EchoData *r)
                return;
        }
 
-       r->out.out_data = TALLOC_ARRAY(p->mem_ctx, uint8, r->in.len);
+       r->out.out_data = talloc_array(p->mem_ctx, uint8, r->in.len);
        memcpy( r->out.out_data, r->in.in_data, r->in.len );
        return;
 }
@@ -76,7 +76,7 @@ void _echo_SourceData(struct pipes_struct *p, struct echo_SourceData *r)
                return;
        }
 
-       r->out.data = TALLOC_ARRAY(p->mem_ctx, uint8, r->in.len );
+       r->out.data = talloc_array(p->mem_ctx, uint8, r->in.len );
 
        for (i = 0; i < r->in.len; i++ ) {
                r->out.data[i] = i & 0xff;
index 393dc314543dead99d7fa9e19ca73db7bb712be6..a120c6e7fe9c5c2e563c44aee7db27ab43192d93 100644 (file)
@@ -858,7 +858,7 @@ static NTSTATUS _lsa_lookup_sids_internal(struct pipes_struct *p,
                return NT_STATUS_OK;
        }
 
-       sids = TALLOC_ARRAY(p->mem_ctx, const struct dom_sid *, num_sids);
+       sids = talloc_array(p->mem_ctx, const struct dom_sid *, num_sids);
        ref = TALLOC_ZERO_P(p->mem_ctx, struct lsa_RefDomainList);
 
        if (sids == NULL || ref == NULL) {
@@ -876,7 +876,7 @@ static NTSTATUS _lsa_lookup_sids_internal(struct pipes_struct *p,
                return status;
        }
 
-       names = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedName2, num_sids);
+       names = talloc_array(p->mem_ctx, struct lsa_TranslatedName2, num_sids);
        if (names == NULL) {
                return NT_STATUS_NO_MEMORY;
        }
@@ -998,7 +998,7 @@ NTSTATUS _lsa_LookupSids(struct pipes_struct *p,
        }
 
        /* Convert from lsa_TranslatedName2 to lsa_TranslatedName */
-       names_out = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedName,
+       names_out = talloc_array(p->mem_ctx, struct lsa_TranslatedName,
                                 num_sids);
        if (!names_out) {
                return NT_STATUS_NO_MEMORY;
@@ -1257,7 +1257,7 @@ NTSTATUS _lsa_LookupNames2(struct pipes_struct *p,
        status = _lsa_LookupNames(p, &q);
 
        sid_array2->count = sid_array->count;
-       sid_array2->sids = TALLOC_ARRAY(p->mem_ctx, struct lsa_TranslatedSid2, sid_array->count);
+       sid_array2->sids = talloc_array(p->mem_ctx, struct lsa_TranslatedSid2, sid_array->count);
        if (!sid_array2->sids) {
                return NT_STATUS_NO_MEMORY;
        }
index 41e684d63d7b0fdced7cd6e4637e41a4dbd41975..186526edfc2669b3e2a1efd56dd1b663123943b2 100644 (file)
@@ -5298,7 +5298,7 @@ NTSTATUS _samr_GetAliasMembership(struct pipes_struct *p,
                return NT_STATUS_OBJECT_TYPE_MISMATCH;
 
        if (r->in.sids->num_sids) {
-               members = TALLOC_ARRAY(p->mem_ctx, struct dom_sid, r->in.sids->num_sids);
+               members = talloc_array(p->mem_ctx, struct dom_sid, r->in.sids->num_sids);
 
                if (members == NULL)
                        return NT_STATUS_NO_MEMORY;
index 6b037232a6c1e68d195c561447c3666f89a464df..f397333b4e443617c59d7ad2101cd40fefb77c19 100644 (file)
@@ -6924,7 +6924,7 @@ static WERROR enumjobs_level1(TALLOC_CTX *mem_ctx,
        int i;
        WERROR result = WERR_OK;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_JobInfo, num_queues);
+       info = talloc_array(mem_ctx, union spoolss_JobInfo, num_queues);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = num_queues;
@@ -6968,7 +6968,7 @@ static WERROR enumjobs_level2(TALLOC_CTX *mem_ctx,
        int i;
        WERROR result = WERR_OK;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_JobInfo, num_queues);
+       info = talloc_array(mem_ctx, union spoolss_JobInfo, num_queues);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = num_queues;
@@ -7023,7 +7023,7 @@ static WERROR enumjobs_level3(TALLOC_CTX *mem_ctx,
        int i;
        WERROR result = WERR_OK;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_JobInfo, num_queues);
+       info = talloc_array(mem_ctx, union spoolss_JobInfo, num_queues);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = num_queues;
@@ -7632,7 +7632,7 @@ static WERROR enumports_hook(TALLOC_CTX *ctx, int *count, char ***lines)
        /* if no hook then just fill in the default port */
 
        if ( !*cmd ) {
-               if (!(qlines = TALLOC_ARRAY( NULL, char*, 2 ))) {
+               if (!(qlines = talloc_array( NULL, char*, 2 ))) {
                        return WERR_NOMEM;
                }
                if (!(qlines[0] = talloc_strdup(qlines, SAMBA_PRINTER_PORT_NAME ))) {
@@ -7693,7 +7693,7 @@ static WERROR enumports_level_1(TALLOC_CTX *mem_ctx,
        }
 
        if (numlines) {
-               info = TALLOC_ARRAY(mem_ctx, union spoolss_PortInfo, numlines);
+               info = talloc_array(mem_ctx, union spoolss_PortInfo, numlines);
                if (!info) {
                        DEBUG(10,("Returning WERR_NOMEM\n"));
                        result = WERR_NOMEM;
@@ -7745,7 +7745,7 @@ static WERROR enumports_level_2(TALLOC_CTX *mem_ctx,
        }
 
        if (numlines) {
-               info = TALLOC_ARRAY(mem_ctx, union spoolss_PortInfo, numlines);
+               info = talloc_array(mem_ctx, union spoolss_PortInfo, numlines);
                if (!info) {
                        DEBUG(10,("Returning WERR_NOMEM\n"));
                        result = WERR_NOMEM;
@@ -8672,7 +8672,7 @@ static WERROR enumprintprocessors_level_1(TALLOC_CTX *mem_ctx,
        union spoolss_PrintProcessorInfo *info;
        WERROR result;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_PrintProcessorInfo, 1);
+       info = talloc_array(mem_ctx, union spoolss_PrintProcessorInfo, 1);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = 1;
@@ -8774,7 +8774,7 @@ static WERROR enumprintprocdatatypes_level_1(TALLOC_CTX *mem_ctx,
        WERROR result;
        union spoolss_PrintProcDataTypesInfo *info;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_PrintProcDataTypesInfo, 1);
+       info = talloc_array(mem_ctx, union spoolss_PrintProcDataTypesInfo, 1);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = 1;
@@ -8890,7 +8890,7 @@ static WERROR enumprintmonitors_level_1(TALLOC_CTX *mem_ctx,
        union spoolss_MonitorInfo *info;
        WERROR result = WERR_OK;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_MonitorInfo, 2);
+       info = talloc_array(mem_ctx, union spoolss_MonitorInfo, 2);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = 2;
@@ -8930,7 +8930,7 @@ static WERROR enumprintmonitors_level_2(TALLOC_CTX *mem_ctx,
        union spoolss_MonitorInfo *info;
        WERROR result = WERR_OK;
 
-       info = TALLOC_ARRAY(mem_ctx, union spoolss_MonitorInfo, 2);
+       info = talloc_array(mem_ctx, union spoolss_MonitorInfo, 2);
        W_ERROR_HAVE_NO_MEMORY(info);
 
        *count = 2;
index c8e96e077dd46f956aaea41ac9236168f204c51c..8505c8ffb5bed5294236eb2b018feaa57b1248fa 100644 (file)
@@ -449,7 +449,7 @@ static WERROR winreg_printer_enumvalues(TALLOC_CTX *mem_ctx,
                return WERR_OK;
        }
 
-       enum_values = TALLOC_ARRAY(tmp_ctx, struct spoolss_PrinterEnumValues, num_values);
+       enum_values = talloc_array(tmp_ctx, struct spoolss_PrinterEnumValues, num_values);
        if (enum_values == NULL) {
                result = WERR_NOMEM;
                goto error;
@@ -3084,7 +3084,7 @@ WERROR winreg_printer_enumforms1(TALLOC_CTX *mem_ctx,
                goto done;
        }
 
-       info = TALLOC_ARRAY(tmp_ctx, union spoolss_FormInfo, num_builtin + num_values);
+       info = talloc_array(tmp_ctx, union spoolss_FormInfo, num_builtin + num_values);
        if (info == NULL) {
                result = WERR_NOMEM;
                goto done;
index bf7ade8be6c2b3548c84519d491c0268aabfa268..b2b8a1923d7d4beb3224dfff422d9275d27be0bf 100644 (file)
@@ -71,7 +71,7 @@ bool init_service_op_table( void )
        int num_services = SVCCTL_NUM_INTERNAL_SERVICES + str_list_length( service_list );
        int i;
 
-       if ( !(svcctl_ops = TALLOC_ARRAY( NULL, struct service_control_op, num_services+1)) ) {
+       if ( !(svcctl_ops = talloc_array( NULL, struct service_control_op, num_services+1)) ) {
                DEBUG(0,("init_service_op_table: talloc() failed!\n"));
                return False;
        }
@@ -421,7 +421,7 @@ static int enumerate_status(TALLOC_CTX *ctx,
        while ( svcctl_ops[num_services].name )
                num_services++;
 
-       if ( !(st = TALLOC_ARRAY( ctx, struct ENUM_SERVICE_STATUSW, num_services )) ) {
+       if ( !(st = talloc_array( ctx, struct ENUM_SERVICE_STATUSW, num_services )) ) {
                DEBUG(0,("enumerate_status: talloc() failed!\n"));
                return -1;
        }
index 6f319e9905460d0a4f54ce4338eab1da54a85589..6fee5b6acd944e30f7609e496e4cea1eda57817e 100644 (file)
@@ -542,7 +542,7 @@ WERROR _winreg_InitiateSystemShutdownEx(struct pipes_struct *p,
                if ( (msg = talloc_strdup(p->mem_ctx, r->in.message->string )) == NULL ) {
                        return WERR_NOMEM;
                }
-               chkmsg = TALLOC_ARRAY(p->mem_ctx, char, strlen(msg)+1);
+               chkmsg = talloc_array(p->mem_ctx, char, strlen(msg)+1);
                if (!chkmsg) {
                        return WERR_NOMEM;
                }
index cda25378ee82832e681fd8bb57195d21293dd393..3382eb1a5c736bde16b093e51e70e8c836f8da4d 100644 (file)
@@ -400,7 +400,7 @@ static NTSTATUS cmd_lsa_lookup_sids(struct rpc_pipe_client *cli, TALLOC_CTX *mem
 
        /* Convert arguments to sids */
 
-       sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, argc - 1);
+       sids = talloc_array(mem_ctx, struct dom_sid, argc - 1);
 
        if (!sids) {
                printf("could not allocate memory for %d sids\n", argc - 1);
@@ -978,7 +978,7 @@ static NTSTATUS cmd_lsa_add_acct_rights(struct rpc_pipe_client *cli,
                goto done;
 
        rights.count = argc-2;
-       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+       rights.names = talloc_array(mem_ctx, struct lsa_StringLarge,
                                    rights.count);
        if (!rights.names) {
                return NT_STATUS_NO_MEMORY;
@@ -1036,7 +1036,7 @@ static NTSTATUS cmd_lsa_remove_acct_rights(struct rpc_pipe_client *cli,
                goto done;
 
        rights.count = argc-2;
-       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+       rights.names = talloc_array(mem_ctx, struct lsa_StringLarge,
                                    rights.count);
        if (!rights.names) {
                return NT_STATUS_NO_MEMORY;
index f135b1e86c5947c9c0ef7056439d731757b97b5e..bcf4d5830d17f9543a2f02750479a0e1d821c589 100644 (file)
@@ -2087,7 +2087,7 @@ static NTSTATUS cmd_samr_lookup_names(struct rpc_pipe_client *cli,
 
        num_names = argc - 2;
 
-       if ((names = TALLOC_ARRAY(mem_ctx, struct lsa_String, num_names)) == NULL) {
+       if ((names = talloc_array(mem_ctx, struct lsa_String, num_names)) == NULL) {
                dcerpc_samr_Close(b, mem_ctx, &domain_pol, &result);
                dcerpc_samr_Close(b, mem_ctx, &connect_pol, &result);
                status = NT_STATUS_NO_MEMORY;
@@ -2167,7 +2167,7 @@ static NTSTATUS cmd_samr_lookup_rids(struct rpc_pipe_client *cli,
 
        num_rids = argc - 2;
 
-       if ((rids = TALLOC_ARRAY(mem_ctx, uint32, num_rids)) == NULL) {
+       if ((rids = talloc_array(mem_ctx, uint32, num_rids)) == NULL) {
                dcerpc_samr_Close(b, mem_ctx, &domain_pol, &result);
                dcerpc_samr_Close(b, mem_ctx, &connect_pol, &result);
                status = NT_STATUS_NO_MEMORY;
index aee6f58fff36aef2184a5e83e480859e5492b6f0..b452000e13921ddbac3689d39d32cfaacf28d5b9 100644 (file)
@@ -742,7 +742,7 @@ void reply_trans(struct smb_request *req)
                        goto bad_param;
                }
 
-               if((state->setup = TALLOC_ARRAY(
+               if((state->setup = talloc_array(
                            state, uint16, state->setup_count)) == NULL) {
                        DEBUG(0,("reply_trans: setup malloc fail for %u "
                                 "bytes !\n", (unsigned int)
index 085834b4ee91ba94147e2322c1cb8823f955f31f..1d296e342df6127cdddec5cccb00ed879a1891d7 100644 (file)
@@ -364,7 +364,7 @@ static bool parse_msdfs_symlink(TALLOC_CTX *ctx,
                return False;
        }
 
-       alt_path = TALLOC_ARRAY(ctx, char *, MAX_REFERRAL_COUNT);
+       alt_path = talloc_array(ctx, char *, MAX_REFERRAL_COUNT);
        if (!alt_path) {
                return False;
        }
@@ -443,7 +443,7 @@ static bool is_msdfs_link_internal(TALLOC_CTX *ctx,
 
        if (pp_link_target) {
                bufsize = 1024;
-               link_target = TALLOC_ARRAY(ctx, char, bufsize);
+               link_target = talloc_array(ctx, char, bufsize);
                if (!link_target) {
                        return False;
                }
@@ -1736,7 +1736,7 @@ struct junction_map *enum_msdfs_links(struct smbd_server_connection *sconn,
        if (jn_count == 0) {
                return NULL;
        }
-       jn = TALLOC_ARRAY(ctx,  struct junction_map, jn_count);
+       jn = talloc_array(ctx,  struct junction_map, jn_count);
        if (!jn) {
                return NULL;
        }
index 06de8ab4320f539fd28e53959c2a3feff6ff8f93..ee7b2ad6d23aca5b50311f8fd7f550ac69e7646f 100644 (file)
@@ -3124,7 +3124,7 @@ NTSTATUS open_streams_for_delete(connection_struct *conn,
                return NT_STATUS_OK;
        }
 
-       streams = TALLOC_ARRAY(talloc_tos(), files_struct *, num_streams);
+       streams = talloc_array(talloc_tos(), files_struct *, num_streams);
        if (streams == NULL) {
                DEBUG(0, ("talloc failed\n"));
                status = NT_STATUS_NO_MEMORY;
@@ -3637,7 +3637,7 @@ NTSTATUS get_relative_fid_filename(connection_struct *conn,
                 * Copy in the base directory name.
                 */
 
-               parent_fname = TALLOC_ARRAY(talloc_tos(), char,
+               parent_fname = talloc_array(talloc_tos(), char,
                    dir_name_len+2);
                if (parent_fname == NULL) {
                        status = NT_STATUS_NO_MEMORY;
index 02eb3361b87965547b33381226527e4205634266..8482a00f641a0fe30cddf280e89f06952ebec373 100644 (file)
@@ -224,7 +224,7 @@ bool should_notify_deferred_opens()
 static char *new_break_message_smb1(TALLOC_CTX *mem_ctx,
                                   files_struct *fsp, int cmd)
 {
-       char *result = TALLOC_ARRAY(mem_ctx, char, smb_size + 8*2 + 0);
+       char *result = talloc_array(mem_ctx, char, smb_size + 8*2 + 0);
 
        if (result == NULL) {
                DEBUG(0, ("talloc failed\n"));
index 01200660fa7fa57cbcb0bdfd571faa50bc0c8bc6..2b8521d54aa13e1fdf6b04baff09e56fd339dd14 100644 (file)
@@ -346,7 +346,7 @@ static NTSTATUS receive_smb_raw_talloc_partial_read(TALLOC_CTX *mem_ctx,
         * talloc and return.
         */
 
-       *buffer = TALLOC_ARRAY(mem_ctx, char, len+4);
+       *buffer = talloc_array(mem_ctx, char, len+4);
 
        if (*buffer == NULL) {
                DEBUG(0, ("Could not allocate inbuf of length %d\n",
@@ -415,7 +415,7 @@ static NTSTATUS receive_smb_raw_talloc(TALLOC_CTX *mem_ctx,
         * The +4 here can't wrap, we've checked the length above already.
         */
 
-       *buffer = TALLOC_ARRAY(mem_ctx, char, len+4);
+       *buffer = talloc_array(mem_ctx, char, len+4);
 
        if (*buffer == NULL) {
                DEBUG(0, ("Could not allocate inbuf of length %d\n",
@@ -1356,7 +1356,7 @@ static bool create_outbuf(TALLOC_CTX *mem_ctx, struct smb_request *req,
                smb_panic(msg);
        }
 
-       *outbuf = TALLOC_ARRAY(mem_ctx, char,
+       *outbuf = talloc_array(mem_ctx, char,
                               smb_size + num_words*2 + num_bytes);
        if (*outbuf == NULL) {
                return false;
index 61e3a7e2d0e2a00562dea6e215a86ff3bcc0bb8f..1980f757fdab12d6d512bb6ff594060ac222bf29 100644 (file)
@@ -3094,9 +3094,9 @@ static void send_file_readbraw(connection_struct *conn,
 
 normal_readbraw:
 
-       outbuf = TALLOC_ARRAY(NULL, char, nread+4);
+       outbuf = talloc_array(NULL, char, nread+4);
        if (!outbuf) {
-               DEBUG(0,("send_file_readbraw: TALLOC_ARRAY failed for size %u.\n",
+               DEBUG(0,("send_file_readbraw: talloc_array failed for size %u.\n",
                        (unsigned)(nread+4)));
                reply_readbraw_error(sconn);
                return;
@@ -4018,7 +4018,7 @@ void reply_writebraw(struct smb_request *req)
        total_written = nwritten;
 
        /* Allocate a buffer of 64k + length. */
-       buf = TALLOC_ARRAY(NULL, char, 65540);
+       buf = talloc_array(NULL, char, 65540);
        if (!buf) {
                reply_nterror(req, NT_STATUS_NO_MEMORY);
                error_to_writebrawerr(req);
index 72907c5d3a1e2ee0468dabc9b8a844ee627c0df4..b9a4d4624b858e137b356f5c10a314294f736662 100644 (file)
@@ -192,7 +192,7 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
         * TALLOC the result early to get the talloc hierarchy right.
         */
 
-       names = TALLOC_ARRAY(mem_ctx, char *, 1);
+       names = talloc_array(mem_ctx, char *, 1);
        if (names == NULL) {
                DEBUG(0, ("talloc failed\n"));
                return NT_STATUS_NO_MEMORY;
@@ -4768,7 +4768,7 @@ NTSTATUS smbd_do_qfilepathinfo(connection_struct *conn,
                case SMB_QUERY_FILE_UNIX_LINK:
                        {
                                int len;
-                               char *buffer = TALLOC_ARRAY(mem_ctx, char, PATH_MAX+1);
+                               char *buffer = talloc_array(mem_ctx, char, PATH_MAX+1);
 
                                if (!buffer) {
                                        return NT_STATUS_NO_MEMORY;
index c73bf6f36bb0a266b6532407746a3aa11cccfbb5..9527a34af4db5350acdaa70019b1ecae8ac7fdbf 100644 (file)
@@ -57,7 +57,7 @@ static NTSTATUS cmd_populate(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int arg
        }
        c = argv[1][0];
        size = atoi(argv[2]);
-       vfs->data = TALLOC_ARRAY(mem_ctx, char, size);
+       vfs->data = talloc_array(mem_ctx, char, size);
        if (vfs->data == NULL) {
                printf("populate: error=-1 (not enough memory)");
                return NT_STATUS_UNSUCCESSFUL;
@@ -435,7 +435,7 @@ static NTSTATUS cmd_read(struct vfs_state *vfs, TALLOC_CTX *mem_ctx, int argc, c
        /* do some error checking on these */
        fd = atoi(argv[1]);
        size = atoi(argv[2]);
-       vfs->data = TALLOC_ARRAY(mem_ctx, char, size);
+       vfs->data = talloc_array(mem_ctx, char, size);
        if (vfs->data == NULL) {
                printf("read: error=-1 (not enough memory)");
                return NT_STATUS_UNSUCCESSFUL;
index 6eca1da693eb8735cdb116d529d84e8585159e9b..9bb34dfe4594c7aa6894f1708778c276d63e249b 100644 (file)
@@ -386,8 +386,8 @@ static void test_mask(int argc, char *argv[],
        while (1) {
                l1 = 1 + random() % 20;
                l2 = 1 + random() % 20;
-               mask = TALLOC_ARRAY(ctx, char, strlen("\\masktest\\")+1+22);
-               file = TALLOC_ARRAY(ctx, char, strlen("\\masktest\\")+1+22);
+               mask = talloc_array(ctx, char, strlen("\\masktest\\")+1+22);
+               file = talloc_array(ctx, char, strlen("\\masktest\\")+1+22);
                if (!mask || !file) {
                        goto finished;
                }
index 47f4efd5d801b52b90d9637a0b882f9793f5a53a..0904f24356be8a4304c5c18a37fe7f6d96c7e384 100644 (file)
@@ -8204,7 +8204,7 @@ static bool run_local_wbclient(int dummy)
                goto fail;
        }
 
-       wb_ctx = TALLOC_ARRAY(ev, struct wb_context *, nprocs);
+       wb_ctx = talloc_array(ev, struct wb_context *, nprocs);
        if (wb_ctx == NULL) {
                goto fail;
        }
index a157e91e5cc5ea190591a747b04553d45e5749c6..d170604a1bf6295e806a5a96107ee07d5ecb655a 100644 (file)
@@ -171,7 +171,7 @@ static bool eventlog_add_source( const char *eventlog, const char *sourcename,
 
        if ( !already_in ) {
                /* make a new list with an additional entry; copy values, add another */
-               wp = TALLOC_ARRAY(ctx, const char *, numsources + 2 );
+               wp = talloc_array(ctx, const char *, numsources + 2 );
 
                if ( !wp ) {
                        d_printf("talloc() failed \n");
index 20a6bdaa249ee3167fb34c39745e19dc0bcd5637..77b15a45c7b4d5395f4b5959d18a611b916c4a91 100644 (file)
@@ -333,8 +333,8 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) ||
-           (!(values = TALLOC_ARRAY(mem_ctx, struct registry_value *,
+       if ((!(names = talloc_array(mem_ctx, char *, num_values))) ||
+           (!(values = talloc_array(mem_ctx, struct registry_value *,
                                     num_values)))) {
                status = NT_STATUS_NO_MEMORY;
                goto error;
@@ -456,8 +456,8 @@ static NTSTATUS registry_enumvalues2(TALLOC_CTX *ctx,
                return NT_STATUS_OK;
        }
 
-       if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) ||
-           (!(values = TALLOC_ARRAY(mem_ctx, struct regval_blob *,
+       if ((!(names = talloc_array(mem_ctx, char *, num_values))) ||
+           (!(values = talloc_array(mem_ctx, struct regval_blob *,
                                     num_values)))) {
                status = NT_STATUS_NO_MEMORY;
                goto error;
index 1b99afa54e8c5f9f63575fd212414c6f9433b95b..737bfb0e8684ba9d434f1cb6ee06e681fecdbdf3 100644 (file)
@@ -506,7 +506,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c,
                return status;
 
        rights.count = argc-1;
-       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+       rights.names = talloc_array(mem_ctx, struct lsa_StringLarge,
                                    rights.count);
        if (!rights.names) {
                return NT_STATUS_NO_MEMORY;
@@ -579,7 +579,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c,
                return status;
 
        rights.count = argc-1;
-       rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge,
+       rights.names = talloc_array(mem_ctx, struct lsa_StringLarge,
                                    rights.count);
        if (!rights.names) {
                return NT_STATUS_NO_MEMORY;
index 392b7131d821d1b89c9763e36fd89a4a3e13dbc2..277b25c4268acfb66446a42e9bd5f6f81083e368 100644 (file)
@@ -101,7 +101,7 @@ static const char *fix_quotes(TALLOC_CTX *ctx, char *str)
                }
                ++p;
        }
-       newstring = TALLOC_ARRAY(ctx, char, newstring_len);
+       newstring = talloc_array(ctx, char, newstring_len);
        if (!newstring) {
                return "";
        }
index 2eb655f78008e2ea70b56203d070fbe0aea69a2e..6ae10115b7813b4a1497faddac72cbedede3790c 100644 (file)
@@ -401,7 +401,7 @@ struct idmap_domain *idmap_find_domain(const char *domname)
                /*
                 * talloc context for all idmap domains
                 */
-               idmap_domains = TALLOC_ARRAY(NULL, struct idmap_domain *, 1);
+               idmap_domains = talloc_array(NULL, struct idmap_domain *, 1);
        }
 
        if (idmap_domains == NULL) {
index e4bf8d59d7a595c8dbe1e0a2c42dbf5d03648cc4..b16aa79997578543e44d3b27af831ce9bf7129c3 100644 (file)
@@ -781,10 +781,10 @@ done:
 #endif
 
        if (count == 0) {
-               ads_tmp = TALLOC_ARRAY(NULL, ADS_STRUCT*, 1);
+               ads_tmp = talloc_array(NULL, ADS_STRUCT*, 1);
                BAIL_ON_PTR_ERROR(ads_tmp, nt_status);
 
-               msg_tmp = TALLOC_ARRAY(NULL, LDAPMessage*, 1);
+               msg_tmp = talloc_array(NULL, LDAPMessage*, 1);
                BAIL_ON_PTR_ERROR(msg_tmp, nt_status);
        } else {
                ads_tmp = talloc_realloc(*ads_list, *ads_list, ADS_STRUCT*,
index 46766dc7b1be2ed1cb9a9757d2268e54dde77208..4832a62f12c5473974df74efe33872fc89f85530 100644 (file)
@@ -128,7 +128,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
                return tevent_req_post(req, ev);
        }
 
-       state->single_sids = TALLOC_ARRAY(state, uint32_t, num_sids);
+       state->single_sids = talloc_array(state, uint32_t, num_sids);
        if (tevent_req_nomem(state->single_sids, req)) {
                return tevent_req_post(req, ev);
        }
@@ -137,7 +137,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
        if (tevent_req_nomem(state->res_domains, req)) {
                return tevent_req_post(req, ev);
        }
-       state->res_domains->domains = TALLOC_ARRAY(
+       state->res_domains->domains = talloc_array(
                state->res_domains, struct lsa_DomainInfo, num_sids);
        if (tevent_req_nomem(state->res_domains->domains, req)) {
                return tevent_req_post(req, ev);
@@ -147,7 +147,7 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
        if (tevent_req_nomem(state->res_names, req)) {
                return tevent_req_post(req, ev);
        }
-       state->res_names->names = TALLOC_ARRAY(
+       state->res_names->names = talloc_array(
                state->res_names, struct lsa_TranslatedName, num_sids);
        if (tevent_req_nomem(state->res_names->names, req)) {
                return tevent_req_post(req, ev);
@@ -187,7 +187,7 @@ static bool wb_lookupsids_next(struct tevent_req *req,
 
                if (sid_check_is_domain(&d->sid)) {
                        state->rids.num_rids = d->sids.num_sids;
-                       state->rids.rids = TALLOC_ARRAY(state, uint32_t,
+                       state->rids.rids = talloc_array(state, uint32_t,
                                                        state->rids.num_rids);
                        if (tevent_req_nomem(state->rids.rids, req)) {
                                return false;
@@ -337,13 +337,13 @@ static struct wb_lookupsids_domain *wb_lookupsids_get_domain(
        sid_split_rid(&domain->sid, NULL);
        domain->domain = wb_domain;
 
-       domain->sids.sids = TALLOC_ARRAY(domains, struct lsa_SidPtr, num_sids);
+       domain->sids.sids = talloc_array(domains, struct lsa_SidPtr, num_sids);
        if (domains->sids.sids == NULL) {
                goto fail;
        }
        domain->sids.num_sids = 0;
 
-       domain->sid_indexes = TALLOC_ARRAY(domains, uint32_t, num_sids);
+       domain->sid_indexes = talloc_array(domains, uint32_t, num_sids);
        if (domain->sid_indexes == NULL) {
                TALLOC_FREE(domain->sids.sids);
                goto fail;
index e1bacedaa4656acbb8776982b77acf9678192527..a1f5ac69b5c48b1a55273092e1244be580f36af3 100644 (file)
@@ -309,7 +309,7 @@ static char *centry_string(struct cache_entry *centry, TALLOC_CTX *mem_ctx)
                smb_panic_fn("centry_string");
        }
 
-       ret = TALLOC_ARRAY(mem_ctx, char, len+1);
+       ret = talloc_array(mem_ctx, char, len+1);
        if (!ret) {
                smb_panic_fn("centry_string out of memory\n");
        }
@@ -339,7 +339,7 @@ static char *centry_hash16(struct cache_entry *centry, TALLOC_CTX *mem_ctx)
                return NULL;
        }
 
-       ret = TALLOC_ARRAY(mem_ctx, char, 16);
+       ret = talloc_array(mem_ctx, char, 16);
        if (!ret) {
                smb_panic_fn("centry_hash out of memory\n");
        }
@@ -1436,7 +1436,7 @@ do_fetch_cache:
        if (*num_entries == 0)
                goto do_cached;
 
-       (*info) = TALLOC_ARRAY(mem_ctx, struct wbint_userinfo, *num_entries);
+       (*info) = talloc_array(mem_ctx, struct wbint_userinfo, *num_entries);
        if (! (*info)) {
                smb_panic_fn("query_user_list out of memory");
        }
@@ -1588,7 +1588,7 @@ do_fetch_cache:
        if (*num_entries == 0)
                goto do_cached;
 
-       (*info) = TALLOC_ARRAY(mem_ctx, struct wb_acct_info, *num_entries);
+       (*info) = talloc_array(mem_ctx, struct wb_acct_info, *num_entries);
        if (! (*info)) {
                smb_panic_fn("enum_dom_groups out of memory");
        }
@@ -1683,7 +1683,7 @@ do_fetch_cache:
        if (*num_entries == 0)
                goto do_cached;
 
-       (*info) = TALLOC_ARRAY(mem_ctx, struct wb_acct_info, *num_entries);
+       (*info) = talloc_array(mem_ctx, struct wb_acct_info, *num_entries);
        if (! (*info)) {
                smb_panic_fn("enum_dom_groups out of memory");
        }
@@ -2006,8 +2006,8 @@ static NTSTATUS rids_to_names(struct winbindd_domain *domain,
                return NT_STATUS_OK;
        }
 
-       *names = TALLOC_ARRAY(mem_ctx, char *, num_rids);
-       *types = TALLOC_ARRAY(mem_ctx, enum lsa_SidType, num_rids);
+       *names = talloc_array(mem_ctx, char *, num_rids);
+       *types = talloc_array(mem_ctx, enum lsa_SidType, num_rids);
 
        if ((*names == NULL) || (*types == NULL)) {
                result = NT_STATUS_NO_MEMORY;
@@ -4203,7 +4203,7 @@ static bool add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom,
 
        if ( !set_only ) {
                if ( !*domains ) {
-                       list = TALLOC_ARRAY( NULL, struct winbindd_tdc_domain, 1 );
+                       list = talloc_array( NULL, struct winbindd_tdc_domain, 1 );
                        idx = 0;
                } else {
                        list = talloc_realloc( *domains, *domains, 
@@ -4346,7 +4346,7 @@ static size_t unpack_tdc_domains( unsigned char *buf, int buflen,
                return 0;
        }
 
-       list = TALLOC_ARRAY( NULL, struct winbindd_tdc_domain, num_domains );
+       list = talloc_array( NULL, struct winbindd_tdc_domain, num_domains );
        if ( !list ) {
                DEBUG(0,("unpack_tdc_domains: Failed to talloc() domain list!\n"));
                return 0;               
index b17cafe5d67a8112d10370378e0b30ea44dcaf21..699320206a231a577e5982a1affde62f3a3e028d 100644 (file)
@@ -342,7 +342,7 @@ static NTSTATUS msrpc_rids_to_names(struct winbindd_domain *domain,
        DEBUG(3, ("msrpc_rids_to_names: domain %s\n", domain->name ));
 
        if (num_rids) {
-               sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_rids);
+               sids = talloc_array(mem_ctx, struct dom_sid, num_rids);
                if (sids == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
index a4e48877031977abeaacac721644fb70c317ada6..df8d7b52c25e21fda75035f838cd2dbd08160d4f 100644 (file)
@@ -404,7 +404,7 @@ NTSTATUS rpc_rids_to_names(TALLOC_CTX *mem_ctx,
        NTSTATUS status;
 
        if (num_rids > 0) {
-               sids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_rids);
+               sids = talloc_array(mem_ctx, struct dom_sid, num_rids);
                if (sids == NULL) {
                        return NT_STATUS_NO_MEMORY;
                }
@@ -594,7 +594,7 @@ NTSTATUS rpc_lookup_usergroups(TALLOC_CTX *mem_ctx,
                return result;
        }
 
-       user_grpsids = TALLOC_ARRAY(mem_ctx, struct dom_sid, num_groups);
+       user_grpsids = talloc_array(mem_ctx, struct dom_sid, num_groups);
        if (user_grpsids == NULL) {
                status = NT_STATUS_NO_MEMORY;
                return status;
index 68616fa5b889ba33f7da6c453301ff7b8d7e8742..203ccfce091fbe02cf7dee45eb283367f3c2bca2 100644 (file)
@@ -85,7 +85,7 @@ struct tevent_req *winbindd_sids_to_xids_send(TALLOC_CTX *mem_ctx,
        if (tevent_req_nomem(state->cached, req)) {
                return tevent_req_post(req, ev);
        }
-       state->non_cached = TALLOC_ARRAY(state, struct dom_sid,
+       state->non_cached = talloc_array(state, struct dom_sid,
                                         state->num_sids);
        if (tevent_req_nomem(state->non_cached, req)) {
                return tevent_req_post(req, ev);
@@ -176,7 +176,7 @@ static void winbindd_sids_to_xids_lookupsids_done(struct tevent_req *subreq)
        }
 
        state->ids.num_ids = state->num_non_cached;
-       state->ids.ids = TALLOC_ARRAY(state, struct wbint_TransID,
+       state->ids.ids = talloc_array(state, struct wbint_TransID,
                                      state->num_non_cached);
        if (tevent_req_nomem(state->ids.ids, req)) {
                return;
index a468b0f8b3dc8cbb41cfb3f5b04d133ed83e0b25..7ed330f81bcc4e127a51858664be278f04b3152a 100644 (file)
@@ -42,7 +42,7 @@ static struct sockaddr_storage *lookup_byname_backend(TALLOC_CTX *mem_ctx,
        if (NT_STATUS_IS_OK(resolve_wins(name,0x20,&ret,count))) {
                if ( *count == 0 )
                        return NULL;
-               return_ss = TALLOC_ARRAY(mem_ctx, struct sockaddr_storage,
+               return_ss = talloc_array(mem_ctx, struct sockaddr_storage,
                                         *count);
                if (return_ss == NULL ) {
                        free( ret );