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/lib/dbwrap_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/dbwrap_file.c') diff --git a/source3/lib/dbwrap_file.c b/source3/lib/dbwrap_file.c index 69ad8e4b20..e195d6f6f3 100644 --- a/source3/lib/dbwrap_file.c +++ b/source3/lib/dbwrap_file.c @@ -168,7 +168,7 @@ static struct db_record *db_file_fetch_locked(struct db_context *db, 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")); -- cgit From d5e6a47f064a3923b1e257ab84fa7ccd7c4f89f4 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:38:41 +1000 Subject: s3-talloc Change TALLOC_P() to talloc() Using the standard macro makes it easier to move code into common, as TALLOC_P isn't standard talloc. --- source3/lib/dbwrap_file.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3/lib/dbwrap_file.c') diff --git a/source3/lib/dbwrap_file.c b/source3/lib/dbwrap_file.c index e195d6f6f3..c27df0cdb9 100644 --- a/source3/lib/dbwrap_file.c +++ b/source3/lib/dbwrap_file.c @@ -80,12 +80,12 @@ static struct db_record *db_file_fetch_locked(struct db_context *db, SMB_ASSERT(ctx->locked_record == NULL); again: - if (!(result = TALLOC_P(mem_ctx, struct db_record))) { + if (!(result = talloc(mem_ctx, struct db_record))) { DEBUG(0, ("talloc failed\n")); return NULL; } - if (!(file = TALLOC_P(result, struct db_locked_file))) { + if (!(file = talloc(result, struct db_locked_file))) { DEBUG(0, ("talloc failed\n")); TALLOC_FREE(result); return NULL; @@ -353,7 +353,7 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx, return NULL; } - if (!(ctx = TALLOC_P(result, struct db_file_ctx))) { + if (!(ctx = talloc(result, struct db_file_ctx))) { DEBUG(0, ("talloc failed\n")); TALLOC_FREE(result); return NULL; -- cgit From ad0a07c531fadd1639c5298951cfaf5cfe0cb10e Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 7 Jun 2011 11:44:43 +1000 Subject: s3-talloc Change TALLOC_ZERO_P() to talloc_zero() Using the standard macro makes it easier to move code into common, as TALLOC_ZERO_P isn't standard talloc. --- source3/lib/dbwrap_file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/dbwrap_file.c') diff --git a/source3/lib/dbwrap_file.c b/source3/lib/dbwrap_file.c index c27df0cdb9..6ecd72810d 100644 --- a/source3/lib/dbwrap_file.c +++ b/source3/lib/dbwrap_file.c @@ -348,7 +348,7 @@ struct db_context *db_open_file(TALLOC_CTX *mem_ctx, struct db_context *result = NULL; struct db_file_ctx *ctx; - if (!(result = TALLOC_ZERO_P(mem_ctx, struct db_context))) { + if (!(result = talloc_zero(mem_ctx, struct db_context))) { DEBUG(0, ("talloc failed\n")); return NULL; } -- cgit