From 3b52902c1924606a3102a8fe92c835d387ade92e Mon Sep 17 00:00:00 2001 From: Matthias Dieter Wallnöfer Date: Sat, 6 Nov 2010 22:39:40 +0100 Subject: s4:descriptor LDB module - remove a bit pointless memory context For only one operation we do not need an additional "mem_ctx". "ac" should be enough (see for example the samldb LDB module). --- source4/dsdb/samdb/ldb_modules/descriptor.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) (limited to 'source4/dsdb/samdb/ldb_modules/descriptor.c') diff --git a/source4/dsdb/samdb/ldb_modules/descriptor.c b/source4/dsdb/samdb/ldb_modules/descriptor.c index 5b74c9c656..935069a00d 100644 --- a/source4/dsdb/samdb/ldb_modules/descriptor.c +++ b/source4/dsdb/samdb/ldb_modules/descriptor.c @@ -672,7 +672,6 @@ static int descriptor_do_add(struct descriptor_context *ac) struct ldb_request *add_req; struct ldb_message_element *objectclass_element, *sd_element = NULL; struct ldb_message *msg; - TALLOC_CTX *mem_ctx; int ret; DATA_BLOB *sd; const struct dsdb_class *objectclass; @@ -682,11 +681,6 @@ static int descriptor_do_add(struct descriptor_context *ac) ldb = ldb_module_get_ctx(ac->module); schema = dsdb_get_schema(ldb, ac); - mem_ctx = talloc_new(ac); - if (mem_ctx == NULL) { - return ldb_module_oom(ac->module); - } - switch (ac->req->operation) { case LDB_ADD: msg = ldb_msg_copy_shallow(ac, ac->req->op.add.message); @@ -738,7 +732,7 @@ static int descriptor_do_add(struct descriptor_context *ac) /* Get the parent descriptor and the one provided. If not * provided, get the default. Convert it to a security * descriptor and calculate the permissions. */ - sd = get_new_descriptor(ac->module, msg->dn, mem_ctx, objectclass, + sd = get_new_descriptor(ac->module, msg->dn, ac, objectclass, ac->parentsd_val, ac->sd_val, NULL, 0); if (ac->sd_val) { ldb_msg_remove_attr(msg, "nTSecurityDescriptor"); @@ -751,8 +745,6 @@ static int descriptor_do_add(struct descriptor_context *ac) } } - talloc_free(mem_ctx); - ret = ldb_build_add_req(&add_req, ldb, ac, msg, ac->req->controls, -- cgit