new_size += (64 - (new_size % 64));
- if (!(new_data = TALLOC_REALLOC_ARRAY(buf, buf->data, uint8,
+ if (!(new_data = talloc_realloc(buf, buf->data, uint8,
new_size))) {
buf->error = ERROR_DNS_NO_MEMORY;
return;
{
struct dns_rrec **new_records;
- if (!(new_records = TALLOC_REALLOC_ARRAY(mem_ctx, *records,
+ if (!(new_records = talloc_realloc(mem_ctx, *records,
struct dns_rrec *,
(*num_records)+1))) {
return ERROR_DNS_NO_MEMORY;
#define TALLOC_ZERO_SIZE(ctx, size) _talloc_zero(ctx, size, __location__)
#define TALLOC_REALLOC(ctx, ptr, count) _talloc_realloc(ctx, ptr, count, __location__)
-#define TALLOC_REALLOC_ARRAY(ctx, ptr, type, count) (type *)_talloc_realloc_array(ctx, ptr, sizeof(type), count, #type)
#define talloc_destroy(ctx) talloc_free(ctx)
#ifndef TALLOC_FREE
#define TALLOC_FREE(ctx) do { talloc_free(ctx); ctx=NULL; } while(0)
#define ADD_TO_ARRAY(mem_ctx, type, elem, array, num) \
do { \
*(array) = ((mem_ctx) != NULL) ? \
- TALLOC_REALLOC_ARRAY(mem_ctx, (*(array)), type, (*(num))+1) : \
+ talloc_realloc(mem_ctx, (*(array)), type, (*(num))+1) : \
SMB_REALLOC_ARRAY((*(array)), type, (*(num))+1); \
SMB_ASSERT((*(array)) != NULL); \
(*(array))[*(num)] = (elem); \
/* Have we got space to append the '\0' ? */
if (size <= dest_len) {
/* No, realloc. */
- dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
+ dest = talloc_realloc(ctx, dest, char,
dest_len+1);
if (!dest) {
/* talloc fail. */
/* Have we got space to append the '\0' ? */
if (size <= dest_len) {
/* No, realloc. */
- dest = TALLOC_REALLOC_ARRAY(ctx, dest, char,
+ dest = talloc_realloc(ctx, dest, char,
dest_len+1);
if (!dest) {
/* talloc fail. */
return NT_STATUS_NO_MEMORY;
}
- if (!(in = TALLOC_REALLOC_ARRAY(ctx, ctx->in.data, uint8, new_size))) {
+ if (!(in = talloc_realloc(ctx, ctx->in.data, uint8, new_size))) {
DEBUG(10, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
}
return NT_STATUS_OK;
}
- if (!(out = TALLOC_REALLOC_ARRAY(ctx, ctx->out.data, uint8, len))) {
+ if (!(out = talloc_realloc(ctx, ctx->out.data, uint8, len))) {
DEBUG(0, ("talloc failed\n"));
return NT_STATUS_NO_MEMORY;
}
idx_len = max_fd+1;
if (talloc_array_length(state->pollfd_idx) < idx_len) {
- state->pollfd_idx = TALLOC_REALLOC_ARRAY(
+ state->pollfd_idx = talloc_realloc(
state, state->pollfd_idx, int, idx_len);
if (state->pollfd_idx == NULL) {
DEBUG(10, ("talloc_realloc failed\n"));
*/
if (talloc_array_length(fds) < num_pollfds + num_fds + 1) {
- fds = TALLOC_REALLOC_ARRAY(mem_ctx, fds, struct pollfd,
+ fds = talloc_realloc(mem_ctx, fds, struct pollfd,
num_pollfds + num_fds + 1);
if (fds == NULL) {
DEBUG(10, ("talloc_realloc failed\n"));
goto done;
}
- if (!(rec = TALLOC_REALLOC_ARRAY(talloc_tos(), msg_array->messages,
+ if (!(rec = talloc_realloc(talloc_tos(), msg_array->messages,
struct messaging_rec,
msg_array->num_messages+1))) {
status = NT_STATUS_NO_MEMORY;
size_t newlen = smb_len(*outbuf) + 4 + blob.length;
uint8 *tmp;
- if (!(tmp = TALLOC_REALLOC_ARRAY(NULL, *outbuf, uint8, newlen))) {
+ if (!(tmp = talloc_realloc(NULL, *outbuf, uint8, newlen))) {
DEBUG(0, ("talloc failed\n"));
return -1;
}
}
if (increased) {
- *string = TALLOC_REALLOC_ARRAY(mem_ctx, *string, char,
+ *string = talloc_realloc(mem_ctx, *string, char,
*bufsize);
if (*string == NULL) {
goto error;
lsize += S_LIST_ABS;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, list, char *,
+ tmp = talloc_realloc(mem_ctx, list, char *,
lsize + 1);
if (tmp == NULL) {
DEBUG(0,("str_list_make: "
va_end(ap);
if (mem_ctx != NULL) {
- *buf = TALLOC_REALLOC_ARRAY(mem_ctx, *buf, uint8,
+ *buf = talloc_realloc(mem_ctx, *buf, uint8,
(*len) + len1);
} else {
*buf = SMB_REALLOC_ARRAY(*buf, uint8, (*len) + len1);
return NT_STATUS_NO_MEMORY;
}
} else {
- if ((tmp_ss_s = TALLOC_REALLOC_ARRAY(dcs,
+ if ((tmp_ss_s = talloc_realloc(dcs,
dcs[i].ss_s,
struct sockaddr_storage,
dcs[i].num_ips+1))
for (curmod=0; modlist[curmod] && modlist[curmod] != (LDAPMod *) -1;
curmod++);
if (modlist[curmod] == (LDAPMod *) -1) {
- if (!(modlist = TALLOC_REALLOC_ARRAY(ctx, modlist, LDAPMod *,
+ if (!(modlist = talloc_realloc(ctx, modlist, LDAPMod *,
curmod+ADS_MODLIST_ALLOC_SIZE+1)))
return ADS_ERROR(LDAP_NO_MEMORY);
memset(&modlist[curmod], 0,
return NULL;
}
- strings = TALLOC_REALLOC_ARRAY(mem_ctx, current_strings, char *,
+ strings = talloc_realloc(mem_ctx, current_strings, char *,
*num_strings + num_new_strings);
if (strings == NULL) {
struct gp_registry_entry **entries,
size_t *num)
{
- *entries = TALLOC_REALLOC_ARRAY(mem_ctx, *entries,
+ *entries = talloc_realloc(mem_ctx, *entries,
struct gp_registry_entry,
(*num)+1);
uint32_t num_entries)
{
/* Re-allocate memory for groupmap and accountmap arrays */
- l->groupmap = TALLOC_REALLOC_ARRAY(mem_ctx,
+ l->groupmap = talloc_realloc(mem_ctx,
l->groupmap,
GROUPMAP,
num_entries + l->num_alloced);
- l->accountmap = TALLOC_REALLOC_ARRAY(mem_ctx,
+ l->accountmap = talloc_realloc(mem_ctx,
l->accountmap,
ACCOUNTMAP,
num_entries + l->num_alloced);
/*
* We're pushing into an SMB buffer, align odd
*/
- buf = TALLOC_REALLOC_ARRAY(NULL, buf, uint8_t, buflen + 1);
+ buf = talloc_realloc(NULL, buf, uint8_t, buflen + 1);
if (buf == NULL) {
return NULL;
}
return NULL;
}
- buf = TALLOC_REALLOC_ARRAY(NULL, buf, uint8_t,
+ buf = talloc_realloc(NULL, buf, uint8_t,
buflen + converted_size);
if (buf == NULL) {
TALLOC_FREE(converted);
}
buflen = talloc_get_size(buf);
- buf = TALLOC_REALLOC_ARRAY(NULL, buf, uint8_t,
+ buf = talloc_realloc(NULL, buf, uint8_t,
buflen + 1 + num_bytes);
if (buf == NULL) {
return NULL;
return tevent_req_post(req, ev);
}
- bytes = TALLOC_REALLOC_ARRAY(state, bytes, uint8_t,
+ bytes = talloc_realloc(state, bytes, uint8_t,
talloc_get_size(bytes)+1);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
return tevent_req_post(req, ev);
}
- bytes = TALLOC_REALLOC_ARRAY(state, bytes, uint8_t,
+ bytes = talloc_realloc(state, bytes, uint8_t,
talloc_get_size(bytes)+1);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
}
- bytes = TALLOC_REALLOC_ARRAY(state, bytes, uint8_t,
+ bytes = talloc_realloc(state, bytes, uint8_t,
talloc_get_size(bytes)+1);
if (tevent_req_nomem(bytes, req)) {
return tevent_req_post(req, ev);
dirlist_len = talloc_get_size(state->dirlist);
- tmp = TALLOC_REALLOC_ARRAY(
+ tmp = talloc_realloc(
state, state->dirlist, uint8_t,
dirlist_len + received * DIR_STRUCT_SIZE);
if (tevent_req_nomem(tmp, req)) {
old_num_finfo = talloc_array_length(state->finfo);
- tmp = TALLOC_REALLOC_ARRAY(state, state->finfo, struct file_info,
+ tmp = talloc_realloc(state, state->finfo, struct file_info,
old_num_finfo + ff_searchcount);
if (tevent_req_nomem(tmp, req)) {
return;
/*
* Shrink state->finfo to the real length we received
*/
- tmp = TALLOC_REALLOC_ARRAY(state, state->finfo, struct file_info,
+ tmp = talloc_realloc(state, state->finfo, struct file_info,
old_num_finfo + i);
if (tevent_req_nomem(tmp, req)) {
return;
nlen = 2*(strlen(state->mask) + 1);
- param = TALLOC_REALLOC_ARRAY(state, state->param, uint8_t,
+ param = talloc_realloc(state, state->param, uint8_t,
12 + nlen + last_name_raw.length + 2);
if (tevent_req_nomem(param, req)) {
return;
struct stream_struct *tmp;
uint8_t *tmp_buf;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, streams,
+ tmp = talloc_realloc(mem_ctx, streams,
struct stream_struct,
num_streams+1);
SIVAL(vwv+2, 0, offset);
SSVAL(vwv+4, 0, 0);
- bytes = TALLOC_REALLOC_ARRAY(talloc_tos(), bytes, uint8_t,
+ bytes = talloc_realloc(talloc_tos(), bytes, uint8_t,
size+3);
if (bytes == NULL) {
return NT_STATUS_NO_MEMORY;
return false;
}
- tmp_addrs = TALLOC_REALLOC_ARRAY(
+ tmp_addrs = talloc_realloc(
state, state->addrs, struct sockaddr_storage,
state->num_addrs + nmb->answers->rdlength/6);
if (tmp_addrs == NULL) {
{
struct stream_struct *tmp;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct,
+ tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct,
(*num_streams)+1);
if (tmp == NULL) {
return false;
again:
- tmp = TALLOC_REALLOC_ARRAY(ctx, val, uint8_t, size);
+ tmp = talloc_realloc(ctx, val, uint8_t, size);
if (tmp == NULL) {
TALLOC_FREE(val);
return NT_STATUS_NO_MEMORY;
m->mnt_fsname += 5;
}
- data->mount_entries = TALLOC_REALLOC_ARRAY(data,
+ data->mount_entries = talloc_realloc(data,
data->mount_entries,
struct fileid_mount_entry,
data->num_mount_entries+1);
nread += thistime;
if (nread == talloc_get_size(namebuf)) {
- namebuf = TALLOC_REALLOC_ARRAY(
+ namebuf = talloc_realloc(
NULL, namebuf, char,
talloc_get_size(namebuf) * 2);
if (namebuf == NULL) {
{
struct stream_struct *tmp;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct,
+ tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct,
(*num_streams)+1);
if (tmp == NULL) {
return false;
{
struct stream_struct *tmp;
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, *streams, struct stream_struct,
+ tmp = talloc_realloc(mem_ctx, *streams, struct stream_struct,
(*num_streams)+1);
if (tmp == NULL) {
return false;
if ((offset + n) > ea.value.length-1) {
uint8 *tmp;
- tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8,
+ tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8,
offset + n + 1);
if (tmp == NULL) {
return -1;
}
- tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), ea.value.data, uint8,
+ tmp = talloc_realloc(talloc_tos(), ea.value.data, uint8,
offset + 1);
if (tmp == NULL) {
return -1;
}
- tmp = TALLOC_REALLOC_ARRAY(
+ tmp = talloc_realloc(
attribs, attribs->eas, struct xattr_EA,
attribs->num_eas+ 1);
if (tmp == NULL) {
- DEBUG(0, ("TALLOC_REALLOC_ARRAY failed\n"));
+ DEBUG(0, ("talloc_realloc failed\n"));
TALLOC_FREE(rec);
errno = ENOMEM;
return -1;
* create_listen_pollfds.
*/
- fds = TALLOC_REALLOC_ARRAY(NULL, fds, struct pollfd, listen_number);
+ fds = talloc_realloc(NULL, fds, struct pollfd, listen_number);
if (fds == NULL) {
return true;
}
#ifndef SYNC_DNS
dns_fd = asyncdns_fd();
if (dns_fd != -1) {
- fds = TALLOC_REALLOC_ARRAY(NULL, fds, struct pollfd, num_sockets+1);
+ fds = talloc_realloc(NULL, fds, struct pollfd, num_sockets+1);
if (fds == NULL) {
return true;
}
;
}
- (*attr_list) = TALLOC_REALLOC_ARRAY(mem_ctx, (*attr_list),
+ (*attr_list) = talloc_realloc(mem_ctx, (*attr_list),
const char *, i+2);
SMB_ASSERT((*attr_list) != NULL);
(*attr_list)[i] = talloc_strdup((*attr_list), new_attr);
return WERR_OK;
}
- if (!(newkeys = TALLOC_REALLOC_ARRAY(ctr, ctr->subkeys, char *,
+ if (!(newkeys = talloc_realloc(ctr, ctr->subkeys, char *,
ctr->num_subkeys+1))) {
return WERR_NOMEM;
}
if ( ctr->num_values == 0 ) {
ctr->values = TALLOC_P( ctr, struct regval_blob *);
} else {
- ctr->values = TALLOC_REALLOC_ARRAY(ctr, ctr->values,
+ ctr->values = talloc_realloc(ctr, ctr->values,
struct regval_blob *,
ctr->num_values+1);
}
bool success = True;
struct PERF_OBJECT_TYPE *obj;
- block->objects = (struct PERF_OBJECT_TYPE *)TALLOC_REALLOC_ARRAY(mem_ctx,
+ block->objects = (struct PERF_OBJECT_TYPE *)talloc_realloc(mem_ctx,
block->objects,
struct PERF_OBJECT_TYPE,
block->NumObjectTypes+1);
SAFE_FREE(data.dptr);
obj->counter_data.ByteLength += dsize + padding;
- obj->counter_data.data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ obj->counter_data.data = talloc_realloc(mem_ctx,
obj->counter_data.data,
uint8,
obj->counter_data.ByteLength - sizeof(uint32));
parent, num));
return False;
}
- obj->counters = (struct PERF_COUNTER_DEFINITION *)TALLOC_REALLOC_ARRAY(mem_ctx,
+ obj->counters = (struct PERF_COUNTER_DEFINITION *)talloc_realloc(mem_ctx,
obj->counters,
struct PERF_COUNTER_DEFINITION,
obj->NumCounters+1);
return False;
}
inst->counter_data.ByteLength = data.dsize + sizeof(inst->counter_data.ByteLength);
- inst->counter_data.data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ inst->counter_data.data = talloc_realloc(mem_ctx,
inst->counter_data.data,
uint8,
data.dsize);
SAFE_FREE(data.dptr);
return False;
}
- inst->data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ inst->data = talloc_realloc(mem_ctx,
inst->data,
uint8,
inst->NameLength);
if((pad = (inst->ByteLength % 8)))
{
pad = 8 - pad;
- inst->data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ inst->data = talloc_realloc(mem_ctx,
inst->data,
uint8,
inst->NameLength + pad);
struct PERF_INSTANCE_DEFINITION *inst;
if(obj->instances == NULL) {
- obj->instances = TALLOC_REALLOC_ARRAY(mem_ctx,
+ obj->instances = talloc_realloc(mem_ctx,
obj->instances,
struct PERF_INSTANCE_DEFINITION,
obj->NumInstances);
counter_data = &(instance->counter_data);
counter = &(object[obj].counters[object[obj].NumCounters - 1]);
counter_data->ByteLength = counter->CounterOffset + counter->CounterSize + sizeof(counter_data->ByteLength);
- temp = TALLOC_REALLOC_ARRAY(mem_ctx,
+ temp = talloc_realloc(mem_ctx,
temp,
char,
counter_data->ByteLength- sizeof(counter_data->ByteLength));
{
pad = 8 - pad;
}
- counter_data->data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ counter_data->data = talloc_realloc(mem_ctx,
counter_data->data,
uint8,
counter_data->ByteLength - sizeof(counter_data->ByteLength) + pad);
if((pad = (object[obj].counter_data.ByteLength % 8)))
{
pad = 8 - pad;
- object[obj].counter_data.data = TALLOC_REALLOC_ARRAY(mem_ctx,
+ object[obj].counter_data.data = talloc_realloc(mem_ctx,
object[obj].counter_data.data,
uint8,
object[obj].counter_data.ByteLength + pad);
/* count the elements */
for (p = a, i = 0; p && *p; p++, i++);
- p = TALLOC_REALLOC_ARRAY(mem_ctx, a, const char *, i + 2);
+ p = talloc_realloc(mem_ctx, a, const char *, i + 2);
if (p == NULL) {
*pwerr = WERR_NOMEM;
return NT_STATUS_OK;
ref->count = num + 1;
ref->max_size = LSA_REF_DOMAIN_LIST_MULTIPLIER;
- ref->domains = TALLOC_REALLOC_ARRAY(mem_ctx, ref->domains,
+ ref->domains = talloc_realloc(mem_ctx, ref->domains,
struct lsa_DomainInfo, ref->count);
if (!ref->domains) {
return -1;
if ( i == ctr->num_groups ) {
ctr->num_groups++;
- if ( !(groups = TALLOC_REALLOC_ARRAY( ctr->ctx, ctr->msg_groups, SPOOLSS_NOTIFY_MSG_GROUP, ctr->num_groups)) ) {
+ if ( !(groups = talloc_realloc( ctr->ctx, ctr->msg_groups, SPOOLSS_NOTIFY_MSG_GROUP, ctr->num_groups)) ) {
DEBUG(0,("notify_msg_ctr_addmsg: talloc_realloc() failed!\n"));
return 0;
}
msg_grp->num_msgs++;
- if ( !(msg_list = TALLOC_REALLOC_ARRAY( ctr->ctx, msg_grp->msgs, SPOOLSS_NOTIFY_MSG, msg_grp->num_msgs )) ) {
+ if ( !(msg_list = talloc_realloc( ctr->ctx, msg_grp->msgs, SPOOLSS_NOTIFY_MSG, msg_grp->num_msgs )) ) {
DEBUG(0,("notify_msg_ctr_addmsg: talloc_realloc() failed for new message [%d]!\n", msg_grp->num_msgs));
return 0;
}
if (!search_notify(type, field, &j) )
continue;
- info->notifies = TALLOC_REALLOC_ARRAY(info, info->notifies,
+ info->notifies = talloc_realloc(info, info->notifies,
struct spoolss_Notify,
info->count + 1);
if (info->notifies == NULL) {
if (!search_notify(type, field, &j) )
continue;
- info->notifies = TALLOC_REALLOC_ARRAY(info, info->notifies,
+ info->notifies = talloc_realloc(info, info->notifies,
struct spoolss_Notify,
info->count + 1);
if (info->notifies == NULL) {
goto out;
}
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
union spoolss_PrinterInfo,
count + 1);
if (!info) {
*count_p = 0;
if (strlen(driver->driver_path)) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
struct spoolss_DriverFileInfo,
count + 1);
W_ERROR_HAVE_NO_MEMORY(info);
}
if (strlen(driver->config_file)) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
struct spoolss_DriverFileInfo,
count + 1);
W_ERROR_HAVE_NO_MEMORY(info);
}
if (strlen(driver->data_file)) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
struct spoolss_DriverFileInfo,
count + 1);
W_ERROR_HAVE_NO_MEMORY(info);
}
if (strlen(driver->help_file)) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
struct spoolss_DriverFileInfo,
count + 1);
W_ERROR_HAVE_NO_MEMORY(info);
}
for (i=0; driver->dependent_files[i] && driver->dependent_files[i][0] != '\0'; i++) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
struct spoolss_DriverFileInfo,
count + 1);
W_ERROR_HAVE_NO_MEMORY(info);
num_drivers, architecture, version));
if (num_drivers != 0) {
- info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+ info = talloc_realloc(mem_ctx, info,
union spoolss_DriverInfo,
count + num_drivers);
if (!info) {
return 1;
}
- f = TALLOC_REALLOC_ARRAY(fenum->ctx, fenum->ctr3->array,
+ f = talloc_realloc(fenum->ctx, fenum->ctr3->array,
struct srvsvc_NetFileInfo3, i+1);
if ( !f ) {
DEBUG(0,("conn_enum_fn: realloc failed for %d items\n", i+1));
return;
}
- f = TALLOC_REALLOC_ARRAY(fenum->ctx, fenum->ctr3->array,
+ f = talloc_realloc(fenum->ctx, fenum->ctr3->array,
struct srvsvc_NetFileInfo3, i+1);
if ( !f ) {
DEBUG(0,("conn_enum_fn: realloc failed for %d items\n", i+1));
for (; resume_handle < *total_entries; resume_handle++) {
- ctr0->array = TALLOC_REALLOC_ARRAY(p->mem_ctx,
+ ctr0->array = talloc_realloc(p->mem_ctx,
ctr0->array,
struct srvsvc_NetSessInfo0,
num_entries+1);
num_files = net_count_files(pw->pw_uid, session_list[resume_handle].pid);
guest = strequal( session_list[resume_handle].username, lp_guestaccount() );
- ctr1->array = TALLOC_REALLOC_ARRAY(p->mem_ctx,
+ ctr1->array = talloc_realloc(p->mem_ctx,
ctr1->array,
struct srvsvc_NetSessInfo1,
num_entries+1);
for (; resume_handle < *total_entries; resume_handle++) {
- ctr0->array = TALLOC_REALLOC_ARRAY(talloc_tos(),
+ ctr0->array = talloc_realloc(talloc_tos(),
ctr0->array,
struct srvsvc_NetConnInfo0,
num_entries+1);
for (; resume_handle < *total_entries; resume_handle++) {
- ctr1->array = TALLOC_REALLOC_ARRAY(talloc_tos(),
+ ctr1->array = talloc_realloc(talloc_tos(),
ctr1->array,
struct srvsvc_NetConnInfo1,
num_entries+1);
}
privs.count++;
- set = TALLOC_REALLOC_ARRAY(mem_ctx, set,
+ set = talloc_realloc(mem_ctx, set,
struct lsa_LUIDAttribute,
privs.count);
if (!set) {
}
privs.count++;
- set = TALLOC_REALLOC_ARRAY(mem_ctx, set,
+ set = talloc_realloc(mem_ctx, set,
struct lsa_LUIDAttribute,
privs.count);
if (!set) {
do {
dm_sessid_t *new_sessions;
nsessions *= 2;
- new_sessions = TALLOC_REALLOC_ARRAY(tmp_ctx, sessions,
+ new_sessions = talloc_realloc(tmp_ctx, sessions,
dm_sessid_t, nsessions);
if (new_sessions == NULL) {
talloc_free(tmp_ctx);
goto send;
}
- state->data = TALLOC_REALLOC_ARRAY(state, state->data, uint8_t,
+ state->data = talloc_realloc(state, state->data, uint8_t,
state->max_read);
if (state->data == NULL) {
reply_nterror(req, NT_STATUS_NO_MEMORY);
len = MIN(SVAL(msg, 0), smbreq_bufrem(req, msg+2));
- tmp = TALLOC_REALLOC_ARRAY(smbd_msg_state, smbd_msg_state->msg,
+ tmp = talloc_realloc(smbd_msg_state, smbd_msg_state->msg,
char, old_len + len);
if (tmp == NULL) {
char **tmp;
- tmp = TALLOC_REALLOC_ARRAY(talloc_tos(), cliprotos, char *,
+ tmp = talloc_realloc(talloc_tos(), cliprotos, char *,
num_cliprotos+1);
if (tmp == NULL) {
DEBUG(0, ("talloc failed\n"));
return;
}
- if (!(changes = TALLOC_REALLOC_ARRAY(
+ if (!(changes = talloc_realloc(
fsp->notify, fsp->notify->changes,
struct notify_change, fsp->notify->num_changes+1))) {
DEBUG(0, ("talloc_realloc failed\n"));
return false;
}
- outbuf = TALLOC_REALLOC_ARRAY(NULL, *poutbuf, uint8_t, new_size);
+ outbuf = talloc_realloc(NULL, *poutbuf, uint8_t, new_size);
if (outbuf == NULL) {
DEBUG(0, ("talloc failed\n"));
return false;
if (!find_andx_cmd_ofs(outbuf, &andx_cmd_ofs)) {
DEBUG(1, ("invalid command chain\n"));
- *poutbuf = TALLOC_REALLOC_ARRAY(
+ *poutbuf = talloc_realloc(
NULL, *poutbuf, uint8_t, old_size);
return false;
}
if ((req->wct < 2) || (CVAL(req->outbuf, smb_wct) < 2)) {
if (req->chain_outbuf == NULL) {
- req->chain_outbuf = TALLOC_REALLOC_ARRAY(
+ req->chain_outbuf = talloc_realloc(
req, req->outbuf, uint8_t,
smb_len(req->outbuf) + 4);
if (req->chain_outbuf == NULL) {
* over-allocated (reply_pipe_read_and_X used to be such an
* example).
*/
- req->chain_outbuf = TALLOC_REALLOC_ARRAY(
+ req->chain_outbuf = talloc_realloc(
req, req->outbuf, uint8_t, smb_len(req->outbuf) + 4);
if (req->chain_outbuf == NULL) {
smb_panic("talloc failed");
{
struct session_list *sesslist = (struct session_list *)private_data;
- sesslist->sessions = TALLOC_REALLOC_ARRAY(
+ sesslist->sessions = talloc_realloc(
sesslist->mem_ctx, sesslist->sessions, struct sessionid,
sesslist->count+1);
*/
grow_size = (strlen(str) + 2) * 4;
- if (!(tmp = TALLOC_REALLOC_ARRAY(NULL, *outbuf, uint8,
+ if (!(tmp = talloc_realloc(NULL, *outbuf, uint8,
buf_size + grow_size))) {
DEBUG(0, ("talloc failed\n"));
return -1;
again:
- val = TALLOC_REALLOC_ARRAY(mem_ctx, val, char, attr_size);
+ val = talloc_realloc(mem_ctx, val, char, attr_size);
if (!val) {
return NT_STATUS_NO_MEMORY;
}
while (ea_namelist_size <= 65536) {
- ea_namelist = TALLOC_REALLOC_ARRAY(
+ ea_namelist = talloc_realloc(
names, ea_namelist, char, ea_namelist_size);
if (ea_namelist == NULL) {
DEBUG(0, ("talloc failed\n"));
num_names += 1;
}
- tmp = TALLOC_REALLOC_ARRAY(mem_ctx, names, char *, num_names);
+ tmp = talloc_realloc(mem_ctx, names, char *, num_names);
if (tmp == NULL) {
DEBUG(0, ("talloc failed\n"));
TALLOC_FREE(names);
for (idx = 0; idx < service->num_params; idx ++) {
if (strequal(service->param_names[idx], "include")) {
- includes = TALLOC_REALLOC_ARRAY(mem_ctx,
+ includes = talloc_realloc(mem_ctx,
includes,
char *,
num_includes+1);
msg_tmp = TALLOC_ARRAY(NULL, LDAPMessage*, 1);
BAIL_ON_PTR_ERROR(msg_tmp, nt_status);
} else {
- ads_tmp = TALLOC_REALLOC_ARRAY(*ads_list, *ads_list, ADS_STRUCT*,
+ ads_tmp = talloc_realloc(*ads_list, *ads_list, ADS_STRUCT*,
count+1);
BAIL_ON_PTR_ERROR(ads_tmp, nt_status);
- msg_tmp = TALLOC_REALLOC_ARRAY(*msg_list, *msg_list, LDAPMessage*,
+ msg_tmp = talloc_realloc(*msg_list, *msg_list, LDAPMessage*,
count+1);
BAIL_ON_PTR_ERROR(msg_tmp, nt_status);
}
return NULL;
}
- domains = TALLOC_REALLOC_ARRAY(
+ domains = talloc_realloc(
mem_ctx, domains, struct wb_lookupsids_domain, num_domains+1);
if (domains == NULL) {
return NULL;
/*
* Realloc to the state it was in before
*/
- *pdomains = TALLOC_REALLOC_ARRAY(
+ *pdomains = talloc_realloc(
mem_ctx, domains, struct wb_lookupsids_domain, num_domains);
return NULL;
}
list = TALLOC_ARRAY( NULL, struct winbindd_tdc_domain, 1 );
idx = 0;
} else {
- list = TALLOC_REALLOC_ARRAY( *domains, *domains,
+ list = talloc_realloc( *domains, *domains,
struct winbindd_tdc_domain,
(*num_domains)+1);
idx = *num_domains;
(struct sockaddr *)(void *)pss))
return False;
- *dcs = TALLOC_REALLOC_ARRAY(mem_ctx, *dcs, struct dc_name_ip, (*num)+1);
+ *dcs = talloc_realloc(mem_ctx, *dcs, struct dc_name_ip, (*num)+1);
if (*dcs == NULL)
return False;
struct sockaddr_storage *pss, uint16 port,
struct sockaddr_storage **addrs, int *num)
{
- *addrs = TALLOC_REALLOC_ARRAY(mem_ctx, *addrs, struct sockaddr_storage, (*num)+1);
+ *addrs = talloc_realloc(mem_ctx, *addrs, struct sockaddr_storage, (*num)+1);
if (*addrs == NULL) {
*num = 0;
}
}
- ids = TALLOC_REALLOC_ARRAY(talloc_tos(), ids,
+ ids = talloc_realloc(talloc_tos(), ids,
struct id_map, num_ids);
if (ids == NULL) {
goto nomem;
}
- id_ptrs = TALLOC_REALLOC_ARRAY(talloc_tos(), id_ptrs,
+ id_ptrs = talloc_realloc(talloc_tos(), id_ptrs,
struct id_map *, num_ids+1);
if (id_ptrs == NULL) {
goto nomem;
}
- id_idx = TALLOC_REALLOC_ARRAY(talloc_tos(), id_idx,
+ id_idx = talloc_realloc(talloc_tos(), id_idx,
uint32_t, num_ids);
if (id_idx == NULL) {
goto nomem;
}
- sids = TALLOC_REALLOC_ARRAY(talloc_tos(), sids,
+ sids = talloc_realloc(talloc_tos(), sids,
struct dom_sid, num_ids);
if (sids == NULL) {
goto nomem;
num_info += num_dom_users;
- info = TALLOC_REALLOC_ARRAY(mem_ctx,
+ info = talloc_realloc(mem_ctx,
info,
struct wbint_userinfo,
num_info);
}
}
- info = TALLOC_REALLOC_ARRAY(mem_ctx,
+ info = talloc_realloc(mem_ctx,
info,
struct wb_acct_info,
num_info + count);
}
}
- info = TALLOC_REALLOC_ARRAY(mem_ctx,
+ info = talloc_realloc(mem_ctx,
info,
struct wb_acct_info,
num_info + count);