*/
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;
}
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;
}
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;
}
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;
}
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);
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;
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;
}
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;
}
* 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;
}
/*
* 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;
}
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,
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;
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;
}
}
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;
}
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;
}
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;
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;
#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)
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"));
* 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;
}
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;
/* 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;
}
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;
TALLOC_FREE(trunc_cmd);
- if (!(argl = TALLOC_ARRAY(mem_ctx, char *, argcl + 1))) {
+ if (!(argl = talloc_array(mem_ctx, char *, argcl + 1))) {
goto nomem;
}
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"));
if (*bufsize == 0)
*bufsize = 128;
- *string = TALLOC_ARRAY(mem_ctx, char, *bufsize);
+ *string = talloc_array(mem_ctx, char, *bufsize);
if (*string == NULL)
goto error;
}
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;
}
}
*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]);
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;
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]));
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;
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"));
/* 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;
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",
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;
*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;
/* 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;
};
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;
}
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;
}
*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);
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,
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;
}
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;
}
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);
}
* 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;
}
* 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;
}
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;
}
newlen++;
}
- dest = TALLOC_ARRAY(ctx, char, newlen);
+ dest = talloc_array(ctx, char, newlen);
if (!dest) {
return err_count;
}
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;
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) {
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)) {
}
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"));
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");
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;
}
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);
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;
}
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);
}
len++;
- to = TALLOC_ARRAY(ctx, char, len);
+ to = talloc_array(ctx, char, len);
if (!to) {
return NULL;
}
}
len++;
- to = TALLOC_ARRAY(ctx, char, len);
+ to = talloc_array(ctx, char, len);
if (!to) {
return NULL;
}
{
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) {
char *namebuf;
void *readbuf;
- namebuf = TALLOC_ARRAY(NULL, char, 1024);
+ namebuf = talloc_array(NULL, char, 1024);
if (namebuf == NULL) {
return false;
}
}
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);
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;
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));
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;
}
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;
}
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;
}
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;
}
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;
}
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);
}
*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;
}
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;
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;
}
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) {
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"));
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;
}
}
*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;
}
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);
* exists
*/
- if (!(state.domains = TALLOC_ARRAY(
+ if (!(state.domains = talloc_array(
mem_ctx, struct trustdom_info *, 1))) {
return NT_STATUS_NO_MEMORY;
}
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;
}
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);
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;
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;
}
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;
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;
}
}
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;
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;
}
/* 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;
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;
/* 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));
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 {
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 {
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 {
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;
}
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;
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) {
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;
}
}
/* 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;
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;
}
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;
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;
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;
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;
/* 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 ))) {
}
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;
}
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;
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;
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;
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;
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;
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;
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;
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;
}
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;
}
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;
}
/* 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);
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;
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;
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;
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;
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)
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;
}
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;
}
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;
}
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;
* 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;
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"));
* 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",
* 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",
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;
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;
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);
* 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;
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;
}
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;
/* 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;
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;
}
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;
}
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");
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;
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;
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;
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;
}
++p;
}
- newstring = TALLOC_ARRAY(ctx, char, newstring_len);
+ newstring = talloc_array(ctx, char, newstring_len);
if (!newstring) {
return "";
}
/*
* 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) {
#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*,
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);
}
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);
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);
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;
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;
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");
}
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");
}
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");
}
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");
}
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");
}
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;
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,
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;
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;
}
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;
}
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;
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);
}
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;
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 );