summaryrefslogtreecommitdiff
path: root/source3/libads
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2011-06-07 11:30:12 +1000
committerAndrew Bartlett <abartlet@samba.org>2011-06-09 12:40:08 +0200
commit3d15137653a7d1b593a9af2eef12f6e5b9a04c4f (patch)
tree325ef987dfbb77144bcb7753c4936cbc8d05379b /source3/libads
parent73b377432c5efb8451f09f6d25d8aa1b28c239c9 (diff)
downloadsamba-3d15137653a7d1b593a9af2eef12f6e5b9a04c4f.tar.gz
samba-3d15137653a7d1b593a9af2eef12f6e5b9a04c4f.tar.bz2
samba-3d15137653a7d1b593a9af2eef12f6e5b9a04c4f.zip
s3-talloc Change TALLOC_ARRAY() to talloc_array()
Using the standard macro makes it easier to move code into common, as TALLOC_ARRAY isn't standard talloc.
Diffstat (limited to 'source3/libads')
-rw-r--r--source3/libads/dns.c6
-rw-r--r--source3/libads/kerberos.c2
-rw-r--r--source3/libads/ldap.c4
-rw-r--r--source3/libads/ldap_printer.c2
-rw-r--r--source3/libads/ldap_schema.c4
-rw-r--r--source3/libads/ldap_utils.c2
6 files changed, 10 insertions, 10 deletions
diff --git a/source3/libads/dns.c b/source3/libads/dns.c
index 08180a65c0..c1332849bf 100644
--- a/source3/libads/dns.c
+++ b/source3/libads/dns.c
@@ -328,7 +328,7 @@ static NTSTATUS dns_send_req( TALLOC_CTX *ctx, const char *name, int q_type,
buf_len = resp_len * sizeof(uint8);
if (buf_len) {
- if ((buffer = TALLOC_ARRAY(ctx, uint8, buf_len))
+ if ((buffer = talloc_array(ctx, uint8, buf_len))
== NULL ) {
DEBUG(0,("ads_dns_lookup_srv: "
"talloc() failed!\n"));
@@ -534,7 +534,7 @@ static NTSTATUS ads_dns_lookup_srv( TALLOC_CTX *ctx,
/* allocate new memory */
if (dcs[i].num_ips == 0) {
- if ((dcs[i].ss_s = TALLOC_ARRAY(dcs,
+ if ((dcs[i].ss_s = talloc_array(dcs,
struct sockaddr_storage, 1 ))
== NULL ) {
return NT_STATUS_NO_MEMORY;
@@ -638,7 +638,7 @@ NTSTATUS ads_dns_lookup_ns(TALLOC_CTX *ctx,
answer_count));
if (answer_count) {
- if ((nsarray = TALLOC_ARRAY(ctx, struct dns_rr_ns,
+ if ((nsarray = talloc_array(ctx, struct dns_rr_ns,
answer_count)) == NULL ) {
DEBUG(0,("ads_dns_lookup_ns: "
"talloc() failure for %d char*'s\n",
diff --git a/source3/libads/kerberos.c b/source3/libads/kerberos.c
index 48a832e1a9..a41686a495 100644
--- a/source3/libads/kerberos.c
+++ b/source3/libads/kerberos.c
@@ -964,7 +964,7 @@ bool create_local_private_krb5_conf_for_domain(const char *realm,
if (S_ISLNK(sbuf.st_ex_mode) && sbuf.st_ex_size) {
int lret;
size_t alloc_size = sbuf.st_ex_size + 1;
- char *linkpath = TALLOC_ARRAY(talloc_tos(), char,
+ char *linkpath = talloc_array(talloc_tos(), char,
alloc_size);
if (!linkpath) {
goto done;
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index f39e6ede5c..743bf42b1e 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -2433,7 +2433,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
*num_values = ldap_count_values(values);
- ret = TALLOC_ARRAY(mem_ctx, char *, *num_values + 1);
+ ret = talloc_array(mem_ctx, char *, *num_values + 1);
if (!ret) {
ldap_value_free(values);
return NULL;
@@ -2669,7 +2669,7 @@ int ads_count_replies(ADS_STRUCT *ads, void *res)
/* nop */ ;
if (i) {
- (*sids) = TALLOC_ARRAY(mem_ctx, struct dom_sid, i);
+ (*sids) = talloc_array(mem_ctx, struct dom_sid, i);
if (!(*sids)) {
ldap_value_free_len(values);
return 0;
diff --git a/source3/libads/ldap_printer.c b/source3/libads/ldap_printer.c
index 3e3ea25840..8ff9f9bdc9 100644
--- a/source3/libads/ldap_printer.c
+++ b/source3/libads/ldap_printer.c
@@ -199,7 +199,7 @@ static bool map_multi_sz(TALLOC_CTX *ctx, ADS_MODLIST *mods,
};
if (num_vals) {
- str_values = TALLOC_ARRAY(ctx, char *, num_vals + 1);
+ str_values = talloc_array(ctx, char *, num_vals + 1);
if (!str_values) {
return False;
}
diff --git a/source3/libads/ldap_schema.c b/source3/libads/ldap_schema.c
index 51aac14906..df13b08f4a 100644
--- a/source3/libads/ldap_schema.c
+++ b/source3/libads/ldap_schema.c
@@ -76,11 +76,11 @@ static ADS_STATUS ads_get_attrnames_by_oids(ADS_STRUCT *ads,
goto out;
}
- if (((*names) = TALLOC_ARRAY(mem_ctx, char *, *count)) == NULL) {
+ if (((*names) = talloc_array(mem_ctx, char *, *count)) == NULL) {
status = ADS_ERROR(LDAP_NO_MEMORY);
goto out;
}
- if (((*OIDs_out) = TALLOC_ARRAY(mem_ctx, char *, *count)) == NULL) {
+ if (((*OIDs_out) = talloc_array(mem_ctx, char *, *count)) == NULL) {
status = ADS_ERROR(LDAP_NO_MEMORY);
goto out;
}
diff --git a/source3/libads/ldap_utils.c b/source3/libads/ldap_utils.c
index ab77abdd16..2f1c1b8e0a 100644
--- a/source3/libads/ldap_utils.c
+++ b/source3/libads/ldap_utils.c
@@ -242,7 +242,7 @@ ADS_STATUS ads_ranged_search(ADS_STRUCT *ads,
*num_strings = 0;
*strings = NULL;
- attrs = TALLOC_ARRAY(mem_ctx, const char *, 3);
+ attrs = talloc_array(mem_ctx, const char *, 3);
ADS_ERROR_HAVE_NO_MEMORY(attrs);
attrs[0] = talloc_strdup(mem_ctx, range_attr);