diff options
author | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-06 22:39:40 +0100 |
---|---|---|
committer | Matthias Dieter Wallnöfer <mdw@samba.org> | 2010-11-07 10:27:24 +0100 |
commit | 3b52902c1924606a3102a8fe92c835d387ade92e (patch) | |
tree | 5c64be31d515ba6344dc6846ccff31b899596a93 /source4/dsdb/samdb/ldb_modules | |
parent | d58a4c55c1564a1b546a79631c1cc2fa5dcba523 (diff) | |
download | samba-3b52902c1924606a3102a8fe92c835d387ade92e.tar.gz samba-3b52902c1924606a3102a8fe92c835d387ade92e.tar.bz2 samba-3b52902c1924606a3102a8fe92c835d387ade92e.zip |
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).
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r-- | source4/dsdb/samdb/ldb_modules/descriptor.c | 10 |
1 files changed, 1 insertions, 9 deletions
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, |