From 28e4616e2094e9f3866547481b68e198892a409b Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sun, 12 Jul 2015 12:37:43 +0200 Subject: [PATCH] tdb_wrap: Use talloc_pooled_object One malloc() less Signed-off-by: Volker Lendecke Reviewed-by: Ralph Boehme --- lib/tdb_wrap/tdb_wrap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/tdb_wrap/tdb_wrap.c b/lib/tdb_wrap/tdb_wrap.c index a1bddf39486..04f8d480663 100644 --- a/lib/tdb_wrap/tdb_wrap.c +++ b/lib/tdb_wrap/tdb_wrap.c @@ -92,14 +92,13 @@ static struct tdb_wrap_private *tdb_wrap_private_open(TALLOC_CTX *mem_ctx, struct tdb_wrap_private *result; struct tdb_logging_context lctx; - result = talloc(mem_ctx, struct tdb_wrap_private); + result = talloc_pooled_object(mem_ctx, struct tdb_wrap_private, + 1, strlen(name)+1); if (result == NULL) { return NULL; } + /* Doesn't fail, see talloc_pooled_object */ result->name = talloc_strdup(result, name); - if (result->name == NULL) { - goto fail; - } lctx.log_fn = tdb_wrap_log; lctx.log_private = NULL; -- 2.11.4.GIT