From: Michael Adam Date: Wed, 30 Jan 2013 14:46:47 +0000 (+0100) Subject: s3:net: introduce a talloc stackframe for net idmap delete X-Git-Tag: tevent-0.9.18~288 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=50e3592ace69a919b3196420e56f09ce435302ea;p=thirdparty%2Fsamba.git 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 --- 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; }