From 50e3592ace69a919b3196420e56f09ce435302ea Mon Sep 17 00:00:00 2001 From: Michael Adam Date: Wed, 30 Jan 2013 15:46:47 +0100 Subject: [PATCH] s3:net: introduce a talloc stackframe for net idmap delete this simplifies the freeing at the end Signed-off-by: Michael Adam Reviewed-by: Christian Ambach --- source3/utils/net_idmap.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/source3/utils/net_idmap.c b/source3/utils/net_idmap.c index 1fb7be03cf9..782b553749c 100644 --- a/source3/utils/net_idmap.c +++ b/source3/utils/net_idmap.c @@ -426,7 +426,7 @@ done: static NTSTATUS dbwrap_delete_mapping(struct db_context *db, TDB_DATA key1, bool force) { - TALLOC_CTX* mem_ctx = talloc_tos(); + TALLOC_CTX *mem_ctx = talloc_stackframe(); bool is_valid_mapping; NTSTATUS status = NT_STATUS_OK; TDB_DATA val1, val2; @@ -483,8 +483,7 @@ NTSTATUS dbwrap_delete_mapping(struct db_context *db, TDB_DATA key1, bool force) } done: - TALLOC_FREE(val1.dptr); - TALLOC_FREE(val2.dptr); + talloc_free(mem_ctx); return status; } -- 2.11.4.GIT