From 3d15137653a7d1b593a9af2eef12f6e5b9a04c4f Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:30:12 +1000 Subject: 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. --- source3/utils/eventlogadm.c | 2 +- source3/utils/net_rpc_registry.c | 8 ++++---- source3/utils/net_rpc_rights.c | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) (limited to 'source3/utils') diff --git a/source3/utils/eventlogadm.c b/source3/utils/eventlogadm.c index a157e91e5c..d170604a1b 100644 --- a/source3/utils/eventlogadm.c +++ b/source3/utils/eventlogadm.c @@ -171,7 +171,7 @@ static bool eventlog_add_source( const char *eventlog, const char *sourcename, if ( !already_in ) { /* make a new list with an additional entry; copy values, add another */ - wp = TALLOC_ARRAY(ctx, const char *, numsources + 2 ); + wp = talloc_array(ctx, const char *, numsources + 2 ); if ( !wp ) { d_printf("talloc() failed \n"); diff --git a/source3/utils/net_rpc_registry.c b/source3/utils/net_rpc_registry.c index 20a6bdaa24..77b15a45c7 100644 --- a/source3/utils/net_rpc_registry.c +++ b/source3/utils/net_rpc_registry.c @@ -333,8 +333,8 @@ static NTSTATUS registry_enumvalues(TALLOC_CTX *ctx, return NT_STATUS_OK; } - if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) || - (!(values = TALLOC_ARRAY(mem_ctx, struct registry_value *, + if ((!(names = talloc_array(mem_ctx, char *, num_values))) || + (!(values = talloc_array(mem_ctx, struct registry_value *, num_values)))) { status = NT_STATUS_NO_MEMORY; goto error; @@ -456,8 +456,8 @@ static NTSTATUS registry_enumvalues2(TALLOC_CTX *ctx, return NT_STATUS_OK; } - if ((!(names = TALLOC_ARRAY(mem_ctx, char *, num_values))) || - (!(values = TALLOC_ARRAY(mem_ctx, struct regval_blob *, + if ((!(names = talloc_array(mem_ctx, char *, num_values))) || + (!(values = talloc_array(mem_ctx, struct regval_blob *, num_values)))) { status = NT_STATUS_NO_MEMORY; goto error; diff --git a/source3/utils/net_rpc_rights.c b/source3/utils/net_rpc_rights.c index 1b99afa54e..737bfb0e86 100644 --- a/source3/utils/net_rpc_rights.c +++ b/source3/utils/net_rpc_rights.c @@ -506,7 +506,7 @@ static NTSTATUS rpc_rights_grant_internal(struct net_context *c, return status; rights.count = argc-1; - rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge, + rights.names = talloc_array(mem_ctx, struct lsa_StringLarge, rights.count); if (!rights.names) { return NT_STATUS_NO_MEMORY; @@ -579,7 +579,7 @@ static NTSTATUS rpc_rights_revoke_internal(struct net_context *c, return status; rights.count = argc-1; - rights.names = TALLOC_ARRAY(mem_ctx, struct lsa_StringLarge, + rights.names = talloc_array(mem_ctx, struct lsa_StringLarge, rights.count); if (!rights.names) { return NT_STATUS_NO_MEMORY; -- cgit