s3-talloc Change TALLOC_REALLOC_ARRAY() to talloc_realloc()
authorAndrew Bartlett <abartlet@samba.org>
Tue, 7 Jun 2011 01:10:15 +0000 (11:10 +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_REALLOC_ARRAY isn't standard talloc.

Andrew Bartlett

51 files changed:
lib/addns/dnsmarshall.c
lib/addns/dnsrecord.c
source3/include/smb_macros.h
source3/lib/charcnv.c
source3/lib/ctdb_packet.c
source3/lib/events.c
source3/lib/messages_local.c
source3/lib/util.c
source3/lib/util_str.c
source3/lib/util_tdb.c
source3/libads/dns.c
source3/libads/ldap.c
source3/libgpo/gpo_reg.c
source3/libnet/libnet_samsync_ldif.c
source3/libsmb/clifile.c
source3/libsmb/clilist.c
source3/libsmb/clirap.c
source3/libsmb/clireadwrite.c
source3/libsmb/namequery.c
source3/modules/onefs_streams.c
source3/modules/vfs_acl_xattr.c
source3/modules/vfs_fileid.c
source3/modules/vfs_preopen.c
source3/modules/vfs_streams_depot.c
source3/modules/vfs_streams_xattr.c
source3/modules/vfs_xattr_tdb.c
source3/nmbd/nmbd_packets.c
source3/passdb/pdb_ldap.c
source3/registry/reg_objects.c
source3/registry/reg_perfcount.c
source3/rpc_client/cli_winreg.c
source3/rpc_server/lsa/srv_lsa_nt.c
source3/rpc_server/spoolss/srv_spoolss_nt.c
source3/rpc_server/srvsvc/srv_srvsvc_nt.c
source3/rpcclient/cmd_lsarpc.c
source3/smbd/dmapi.c
source3/smbd/ipc.c
source3/smbd/message.c
source3/smbd/negprot.c
source3/smbd/notify.c
source3/smbd/process.c
source3/smbd/session.c
source3/smbd/srvstr.c
source3/smbd/trans2.c
source3/utils/net_conf.c
source3/winbindd/idmap_adex/gc_util.c
source3/winbindd/wb_lookupsids.c
source3/winbindd/winbindd_cache.c
source3/winbindd/winbindd_cm.c
source3/winbindd/winbindd_dual_srv.c
source3/winbindd/winbindd_rpc.c

index 5530290c57a5126c06d1ee456d78e846336de217..e5e8cf796217b58483d621e678df6e4ca2e5d5fa 100644 (file)
@@ -78,7 +78,7 @@ void dns_marshall_buffer(struct dns_buffer *buf, const uint8 *data,
 
                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;
index 528fdf29ab320c1a1e213134a118c5a6ae0b4a15..52391aef78080c57bb65879288c88e8966d34b5d 100644 (file)
@@ -308,7 +308,7 @@ DNS_ERROR dns_add_rrec(TALLOC_CTX *mem_ctx, struct dns_rrec *rec,
 {
        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;
index ccf99daaea64ed4e120c22ad558ecf442c9dcd23..cb364a9aa3abc4d2d5e59169f5f0b499bab3e72a 100644 (file)
@@ -229,7 +229,6 @@ copy an IP address from one buffer to another
 #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)
@@ -292,7 +291,7 @@ copy an IP address from one buffer to another
 #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); \
index 1e44b81af9f7e3aa5cb1b00ff9749b3537d79ca4..17e836dfe0f35c93094e3defdd0e5d8f816aaea9 100644 (file)
@@ -202,7 +202,7 @@ static size_t pull_ascii_base_talloc(TALLOC_CTX *ctx,
                        /* 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. */
@@ -449,7 +449,7 @@ static size_t pull_ucs2_base_talloc(TALLOC_CTX *ctx,
                        /* 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. */
index 03be372f193d5b220780578fcfb81036af05c2be..35c76fa44ff3f641ccca666b9b637fc40d5bcf9e 100644 (file)
@@ -82,7 +82,7 @@ NTSTATUS ctdb_packet_fd_read(struct ctdb_packet_context *ctx)
                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;
        }
@@ -245,7 +245,7 @@ NTSTATUS ctdb_packet_send(struct ctdb_packet_context *ctx, int num_blobs, ...)
                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;
        }
index fbe3db942b4d93084c976c01176d82bab15fc52e..fc7f1d493a35d0684721b974cad253462f2bead1 100644 (file)
@@ -90,7 +90,7 @@ bool event_add_to_poll_args(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
        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"));
@@ -107,7 +107,7 @@ bool event_add_to_poll_args(struct tevent_context *ev, TALLOC_CTX *mem_ctx,
         */
 
        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"));
index f82b107bcc5559877c508e91204d02b42dce20c0..9bfe6e68e00326b729de0390fa9f7f8c9b98cf42 100644 (file)
@@ -371,7 +371,7 @@ static NTSTATUS messaging_tdb_send(struct messaging_context *msg_ctx,
                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;
index 5aad2435932bf86eaf60c0f823b026bad56a18c7..b4af9fbc0e1364aaa8435efd812cf15e59d2d4c6 100644 (file)
@@ -226,7 +226,7 @@ ssize_t message_push_blob(uint8 **outbuf, DATA_BLOB blob)
        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;
        }
index f039a3a52288a2ca5c0e9511f1358299e5ff5994..6fe8f67448fb2567418b9f4b02176df68819fe36 100644 (file)
@@ -948,7 +948,7 @@ void sprintf_append(TALLOC_CTX *mem_ctx, char **string, ssize_t *len,
        }
 
        if (increased) {
-               *string = TALLOC_REALLOC_ARRAY(mem_ctx, *string, char,
+               *string = talloc_realloc(mem_ctx, *string, char,
                                               *bufsize);
                if (*string == NULL) {
                        goto error;
@@ -1253,7 +1253,7 @@ char **str_list_make_v3(TALLOC_CTX *mem_ctx, const char *string,
 
                        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: "
index 654a538a884140804fc5980d0c62e974336b5cd9..5c3dc3a07dc3aad87e494242028e03e04eec4de4 100644 (file)
@@ -231,7 +231,7 @@ bool tdb_pack_append(TALLOC_CTX *mem_ctx, uint8 **buf, size_t *len,
        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);
index 152003941b52bac16b55f3a5b6aca36d938ae772..08180a65c0ca21b4c1dfda7329403cd3d8f1c169 100644 (file)
@@ -540,7 +540,7 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
                                                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))
index 375dc3bf2763ad6d5d6df5a30a308b1f8f101296..f39e6ede5c4ce067951f83e0725afb961baaf897 100644 (file)
@@ -1422,7 +1422,7 @@ static ADS_STATUS ads_modlist_add(TALLOC_CTX *ctx, ADS_MODLIST *mods,
        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, 
@@ -2546,7 +2546,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
                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) {
index d9fcd43cafc059cb951f6a7c80e425b2c268daf7..29b31aec8edec2422755d5cfc26c46aaf297ef55 100644 (file)
@@ -901,7 +901,7 @@ bool add_gp_registry_entry_to_array(TALLOC_CTX *mem_ctx,
                                    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);
 
index 3f7fb347dd530d3c847c97bdc1227b326332a1e8..bcdcd48ecf9635186dc3aa73d65b07b561af644d 100644 (file)
@@ -1200,12 +1200,12 @@ static NTSTATUS ldif_realloc_maps(TALLOC_CTX *mem_ctx,
                                  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);
index 1bf72aaf8fb8e556e79eb86c4ccd0c19d5115476..8b76e8f5d8b8c7190cf5edcb4d1d0cec90ba1146 100644 (file)
@@ -52,7 +52,7 @@ static uint8_t *internal_bytes_push_str(uint8_t *buf, bool ucs2,
                /*
                 * 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;
                }
@@ -67,7 +67,7 @@ static uint8_t *internal_bytes_push_str(uint8_t *buf, bool ucs2,
                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);
@@ -108,7 +108,7 @@ uint8_t *smb_bytes_push_bytes(uint8_t *buf, uint8_t prefix,
        }
        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;
@@ -1031,7 +1031,7 @@ struct tevent_req *cli_rename_send(TALLOC_CTX *mem_ctx,
                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);
@@ -1153,7 +1153,7 @@ static struct tevent_req *cli_ntrename_internal_send(TALLOC_CTX *mem_ctx,
                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);
@@ -3349,7 +3349,7 @@ struct tevent_req *cli_setatr_send(TALLOC_CTX *mem_ctx,
        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);
index 49354e66bdb131d9918675ec18d770c4563ae22d..83cc81549a96d6fb4367dc8c3490215864ad8590 100644 (file)
@@ -387,7 +387,7 @@ static void cli_list_old_done(struct tevent_req *subreq)
 
                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)) {
@@ -654,7 +654,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
 
        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;
@@ -711,7 +711,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
        /*
         * 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;
@@ -736,7 +736,7 @@ static void cli_list_trans_done(struct tevent_req *subreq)
 
        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;
index 3e5f08dd3cb6641d5a3bc97816c93a017636ffeb..008db0b65a2c0491d3c8c3294a2c9d4e34409962 100644 (file)
@@ -998,7 +998,7 @@ static bool parse_streams_blob(TALLOC_CTX *mem_ctx, const uint8_t *rdata,
                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);
 
index 9f228c9b08d7a73e0425c97cae5f82512f285ae8..fc6c9ffc0053f5fa545063a83a219781ce0e6f7d 100644 (file)
@@ -722,7 +722,7 @@ NTSTATUS cli_smbwrite(struct cli_state *cli, uint16_t fnum, char *buf,
                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;
index 2ad10710a9d22179b329f7f90b6345d861851766..eec42ff6226b967603b52247fa5df35098d75de5 100644 (file)
@@ -1317,7 +1317,7 @@ static bool name_query_validator(struct packet_struct *p, void *private_data)
                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) {
index 2634ea77a1d21b3b8eea37b2b166bc9cd31c81b6..78230bcad675d7de9685b4461b662bf7c211701e 100644 (file)
@@ -552,7 +552,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 {
        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;
index 2a83430fa9471138404b93e26577463d8c6d69ea..70e979b71b06f53d0f83797758ac215aba618b91 100644 (file)
@@ -55,7 +55,7 @@ static NTSTATUS get_acl_blob(TALLOC_CTX *ctx,
 
   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;
index 642628082aaacab498973052e6a443368cb5398c..1168d50cb2e4c472daa33414874dcf13dfd4d3af 100644 (file)
@@ -66,7 +66,7 @@ static void fileid_load_mount_entries(struct fileid_handle_data *data)
                        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);
index e0d1fd7ec08508cd078c6db6a92d57a1f8986a0b..b29a4c4351d0d88dd36041b620dda031a16fdfee 100644 (file)
@@ -166,7 +166,7 @@ static bool preopen_helper_open_one(int sock_fd, char **pnamebuf,
                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) {
index f1c687e9528b41613a77e2e4b47814628a0c37e2..3569405da305e7fa3ce89df82f457c0d9cc51b2f 100644 (file)
@@ -716,7 +716,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 {
        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;
index 3a001e445c24b39bff96aae0b0164458a5cfc28e..2772c96c4d8f1f938cd4151d0922985a86e76561 100644 (file)
@@ -731,7 +731,7 @@ static bool add_one_stream(TALLOC_CTX *mem_ctx, unsigned int *num_streams,
 {
        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;
@@ -880,7 +880,7 @@ static ssize_t streams_xattr_pwrite(vfs_handle_struct *handle,
         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) {
@@ -986,7 +986,7 @@ static int streams_xattr_ftruncate(struct vfs_handle_struct *handle,
                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) {
index 2cfea9cacd5d5e3753963f9c0f0cc3bf4d85a58e..23bb35041ee3ef23e2dd8a32c2cce9072ab99780 100644 (file)
@@ -299,12 +299,12 @@ static int xattr_tdb_setattr(struct db_context *db_ctx,
                        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;
index f414c9c86247b324ca107904f44b1b4488005ca3..12e3ab17e3295d1c17d56f4945fdb67438759fbd 100644 (file)
@@ -1885,7 +1885,7 @@ bool listen_for_packets(bool run_election)
         * 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;
        }
@@ -1894,7 +1894,7 @@ bool listen_for_packets(bool run_election)
 #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;
                }
index aef1d31eb6bf3474a44bf09e3d9c95c26b284555..c21b54f74de1944a34c6f5f202cd7641d8a8e9e7 100644 (file)
@@ -1532,7 +1532,7 @@ static void append_attr(TALLOC_CTX *mem_ctx, const char ***attr_list,
                ;
        }
 
-       (*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);
index 980986f95bf1a52a354fcb0195da7973ce549ccb..389975587d7880b0d97c396b941e310041b88e68 100644 (file)
@@ -211,7 +211,7 @@ WERROR regsubkey_ctr_addkey( struct regsubkey_ctr *ctr, const char *keyname )
                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;
        }
@@ -507,7 +507,7 @@ int regval_ctr_addvalue(struct regval_ctr *ctr, const char *name, uint32_t type,
        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);
        }
index 8a2b444e0126b56e5f7c2bb5d715d4217920246a..1ba8915b4c8c2797c4f9ff974663577c103b7c82 100644 (file)
@@ -376,7 +376,7 @@ static bool _reg_perfcount_add_object(struct PERF_DATA_BLOCK *block,
        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);
@@ -547,7 +547,7 @@ static bool _reg_perfcount_get_counter_info(struct PERF_DATA_BLOCK *block,
        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));
@@ -635,7 +635,7 @@ static bool _reg_perfcount_add_counter(struct PERF_DATA_BLOCK *block,
                                  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);
@@ -687,7 +687,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
                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);
@@ -719,7 +719,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
                        SAFE_FREE(data.dptr);
                        return False;
                }
-               inst->data = TALLOC_REALLOC_ARRAY(mem_ctx,
+               inst->data = talloc_realloc(mem_ctx,
                                                  inst->data,
                                                  uint8,
                                                  inst->NameLength);
@@ -741,7 +741,7 @@ static bool _reg_perfcount_get_instance_info(struct PERF_INSTANCE_DEFINITION *in
        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);
@@ -763,7 +763,7 @@ static bool _reg_perfcount_add_instance(struct PERF_OBJECT_TYPE *obj,
        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);
@@ -993,7 +993,7 @@ static uint32 _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block
                                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));
@@ -1014,7 +1014,7 @@ static uint32 _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block
                                {
                                        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);
@@ -1034,7 +1034,7 @@ static uint32 _reg_perfcount_perf_data_block_fixup(struct PERF_DATA_BLOCK *block
                        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);
index 2517dbc50ab9c7d270810c7ee7bddd41a0702c71..3731fc7e799ef1e59ae16737a68ebd4321783c95 100644 (file)
@@ -615,7 +615,7 @@ NTSTATUS dcerpc_winreg_add_multi_sz(TALLOC_CTX *mem_ctx,
        /* 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;
index da0f697dc9815c789e1617af0120a0bc5c2b42f4..393dc314543dead99d7fa9e19ca73db7bb712be6 100644 (file)
@@ -122,7 +122,7 @@ static int init_lsa_ref_domain_list(TALLOC_CTX *mem_ctx,
        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;
index a946bc91d0fa55cbfd948af19f53563d51dd4699..6b037232a6c1e68d195c561447c3666f89a464df 100644 (file)
@@ -1094,7 +1094,7 @@ static int notify_msg_ctr_addmsg( SPOOLSS_NOTIFY_MSG_CTR *ctr, SPOOLSS_NOTIFY_MS
        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;
                }
@@ -1112,7 +1112,7 @@ static int notify_msg_ctr_addmsg( SPOOLSS_NOTIFY_MSG_CTR *ctr, SPOOLSS_NOTIFY_MS
 
        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;
        }
@@ -3438,7 +3438,7 @@ static bool construct_notify_printer_info(struct messaging_context *msg_ctx,
                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) {
@@ -3498,7 +3498,7 @@ static bool construct_notify_jobs_info(struct messaging_context *msg_ctx,
                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) {
@@ -4307,7 +4307,7 @@ static WERROR enum_all_printers_info_level(TALLOC_CTX *mem_ctx,
                        goto out;
                }
 
-               info = TALLOC_REALLOC_ARRAY(mem_ctx, info,
+               info = talloc_realloc(mem_ctx, info,
                                            union spoolss_PrinterInfo,
                                            count + 1);
                if (!info) {
@@ -5347,7 +5347,7 @@ static WERROR spoolss_DriverFileInfo_from_driver(TALLOC_CTX *mem_ctx,
        *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);
@@ -5362,7 +5362,7 @@ static WERROR spoolss_DriverFileInfo_from_driver(TALLOC_CTX *mem_ctx,
        }
 
        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);
@@ -5377,7 +5377,7 @@ static WERROR spoolss_DriverFileInfo_from_driver(TALLOC_CTX *mem_ctx,
        }
 
        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);
@@ -5392,7 +5392,7 @@ static WERROR spoolss_DriverFileInfo_from_driver(TALLOC_CTX *mem_ctx,
        }
 
        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);
@@ -5407,7 +5407,7 @@ static WERROR spoolss_DriverFileInfo_from_driver(TALLOC_CTX *mem_ctx,
        }
 
        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);
@@ -7292,7 +7292,7 @@ static WERROR enumprinterdrivers_level_by_architecture(TALLOC_CTX *mem_ctx,
                          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) {
index 7251d70dd986e3764f382b9f43140ae3f3ed50f6..c63a81dd77bfd6b182b405f7c11534e92f9612b4 100644 (file)
@@ -101,7 +101,7 @@ static int pipe_enum_fn( struct db_record *rec, void *p)
                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));
@@ -179,7 +179,7 @@ static void enum_file_fn( const struct share_mode_entry *e,
                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));
@@ -816,7 +816,7 @@ static WERROR init_srv_sess_info_0(struct pipes_struct *p,
 
        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);
@@ -914,7 +914,7 @@ static WERROR init_srv_sess_info_1(struct pipes_struct *p,
                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);
@@ -969,7 +969,7 @@ static WERROR init_srv_conn_info_0(struct srvsvc_NetConnCtr0 *ctr0,
 
        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);
@@ -1023,7 +1023,7 @@ static WERROR init_srv_conn_info_1(struct srvsvc_NetConnCtr1 *ctr1,
 
        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);
index 4b065d0dd2d0cb2b1bc300079d0ad722f5d8318d..cda25378ee82832e681fd8bb57195d21293dd393 100644 (file)
@@ -1494,7 +1494,7 @@ static NTSTATUS cmd_lsa_add_priv(struct rpc_pipe_client *cli,
                }
 
                privs.count++;
-               set = TALLOC_REALLOC_ARRAY(mem_ctx, set,
+               set = talloc_realloc(mem_ctx, set,
                                           struct lsa_LUIDAttribute,
                                           privs.count);
                if (!set) {
@@ -1592,7 +1592,7 @@ static NTSTATUS cmd_lsa_del_priv(struct rpc_pipe_client *cli,
                }
 
                privs.count++;
-               set = TALLOC_REALLOC_ARRAY(mem_ctx, set,
+               set = talloc_realloc(mem_ctx, set,
                                           struct lsa_LUIDAttribute,
                                           privs.count);
                if (!set) {
index 28440783abe3856c10d7fdf62e017abea36e8146..8e80a588c5f619e9f6fe112ca783137b387875d2 100644 (file)
@@ -96,7 +96,7 @@ static int dmapi_init_session(struct smbd_dmapi_context *ctx)
        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);
index 0b12179adc6b0f7c461ae72d212bc7f2e8e2e67a..aee6f58fff36aef2184a5e83e480859e5492b6f0 100644 (file)
@@ -298,7 +298,7 @@ static void api_dcerpc_cmd_write_done(struct tevent_req *subreq)
                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);
index 34997a13dc51675224a6fa426b80249a17b5231c..1877582d53bd4ef6b35b7028642c226c40073beb 100644 (file)
@@ -259,7 +259,7 @@ void reply_sendtxt(struct smb_request *req)
 
        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) {
index aa10563aaed290859ad82468b8e69147838a8368..da66dad0d828bf41b1122c18dd793592000fe194 100644 (file)
@@ -573,7 +573,7 @@ void reply_negprot(struct smb_request *req)
 
                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"));
index 24385c94a0d04e14bbef067857a6a547c2d1b495..d711cd69be0e730ebeff5138573b42eb510a1d89 100644 (file)
@@ -424,7 +424,7 @@ static void notify_fsp(files_struct *fsp, uint32 action, const char *name)
                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"));
index 7d9626387d2e1ee625f9f83ec8664db4c13abe0f..01200660fa7fa57cbcb0bdfd571faa50bc0c8bc6 100644 (file)
@@ -1894,7 +1894,7 @@ static bool smb_splice_chain(uint8_t **poutbuf, uint8_t smb_command,
                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;
@@ -1908,7 +1908,7 @@ static bool smb_splice_chain(uint8_t **poutbuf, uint8_t smb_command,
 
                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;
                }
@@ -1996,7 +1996,7 @@ void chain_reply(struct smb_request *req)
 
        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) {
@@ -2028,7 +2028,7 @@ void chain_reply(struct smb_request *req)
                 * 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");
index f3a678b2055302f15b0ef0ceb699429458b94962..12d4818e90ca8c548c5e2b5572911ea459e1fe82 100644 (file)
@@ -231,7 +231,7 @@ static int gather_sessioninfo(const char *key, struct sessionid *session,
 {
        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);
 
index 050de599a5779078aa083dac03aba13ca0a527ec..c069dd4a5ecb1fec0dca400eaabd5a754e8d3dd7 100644 (file)
@@ -56,7 +56,7 @@ ssize_t message_push_string(uint8 **outbuf, const char *str, int flags)
         */
        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;
index cc21b32fe7e16a7291c85e62f270817f6b59d9e9..72907c5d3a1e2ee0468dabc9b8a844ee627c0df4 100644 (file)
@@ -129,7 +129,7 @@ NTSTATUS get_ea_value(TALLOC_CTX *mem_ctx, connection_struct *conn,
 
  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;
        }
@@ -200,7 +200,7 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
 
        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"));
@@ -259,7 +259,7 @@ NTSTATUS get_ea_names_from_file(TALLOC_CTX *mem_ctx, connection_struct *conn,
                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);
index 6c61dd7206105896bb4a7d2a11d202110d74a1a2..0ae120669993be06ebd58a5b573add3fa36d4069 100644 (file)
@@ -212,7 +212,7 @@ static sbcErr import_process_service(struct net_context *c,
 
        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);
index e625265be0418659059c087358fa00b4cfe5c1f4..e4bf8d59d7a595c8dbe1e0a2c42dbf5d03648cc4 100644 (file)
@@ -787,11 +787,11 @@ done:
                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);
        }
index 05601ad192b19afb794eea41f8f04dccf6ee7c7a..46766dc7b1be2ed1cb9a9757d2268e54dde77208 100644 (file)
@@ -325,7 +325,7 @@ static struct wb_lookupsids_domain *wb_lookupsids_get_domain(
                return NULL;
        }
 
-       domains = TALLOC_REALLOC_ARRAY(
+       domains = talloc_realloc(
                mem_ctx, domains, struct wb_lookupsids_domain, num_domains+1);
        if (domains == NULL) {
                return NULL;
@@ -354,7 +354,7 @@ fail:
        /*
         * 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;
 }
index 50da98f62cabb0d3f3d7a4c61c3cd5a5a30b21f3..e1bacedaa4656acbb8776982b77acf9678192527 100644 (file)
@@ -4206,7 +4206,7 @@ static bool add_wbdomain_to_tdc_array( struct winbindd_domain *new_dom,
                        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;             
index c6c93baea9876a5451dfc4cbd8d6ce63d285cb93..726e99787f6969bb6d545ef33996e9b2a6d9465b 100644 (file)
@@ -1082,7 +1082,7 @@ static bool add_one_dc_unique(TALLOC_CTX *mem_ctx, const char *domain_name,
                            (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;
@@ -1097,7 +1097,7 @@ static bool add_sockaddr_to_array(TALLOC_CTX *mem_ctx,
                                  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;
index f42682e5f81177befd74ab87d15f3804a8396583..c2510bc84d9698fc46c3e749019ac1fd3291b1ae 100644 (file)
@@ -148,22 +148,22 @@ NTSTATUS _wbint_Sids2UnixIDs(struct pipes_struct *p,
                        }
                }
 
-               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;
index bf438a6d5cd6ac07f04cbe8245cf1e7da5c29078..a4e48877031977abeaacac721644fb70c317ada6 100644 (file)
@@ -89,7 +89,7 @@ NTSTATUS rpc_query_user_list(TALLOC_CTX *mem_ctx,
 
                num_info += num_dom_users;
 
-               info = TALLOC_REALLOC_ARRAY(mem_ctx,
+               info = talloc_realloc(mem_ctx,
                                            info,
                                            struct wbint_userinfo,
                                            num_info);
@@ -181,7 +181,7 @@ NTSTATUS rpc_enum_dom_groups(TALLOC_CTX *mem_ctx,
                        }
                }
 
-               info = TALLOC_REALLOC_ARRAY(mem_ctx,
+               info = talloc_realloc(mem_ctx,
                                            info,
                                            struct wb_acct_info,
                                            num_info + count);
@@ -241,7 +241,7 @@ NTSTATUS rpc_enum_local_groups(TALLOC_CTX *mem_ctx,
                        }
                }
 
-               info = TALLOC_REALLOC_ARRAY(mem_ctx,
+               info = talloc_realloc(mem_ctx,
                                            info,
                                            struct wb_acct_info,
                                            num_info + count);