From: Matthias Dieter Wallnöfer Date: Wed, 7 Jul 2010 16:01:34 +0000 (+0200) Subject: s4:acl LDB module - move a "mem_ctx" creation to the place where it is actually checked X-Git-Url: http://git.samba.org/?p=kamenim%2Fsamba.git;a=commitdiff_plain;h=921308f1e830e0443bb49b6d4eb19ae95357a16e s4:acl LDB module - move a "mem_ctx" creation to the place where it is actually checked Memory allocations and their result checks should be as tight as possible. --- diff --git a/source4/dsdb/samdb/ldb_modules/acl.c b/source4/dsdb/samdb/ldb_modules/acl.c index 2b0b19c726..39b8e9911f 100644 --- a/source4/dsdb/samdb/ldb_modules/acl.c +++ b/source4/dsdb/samdb/ldb_modules/acl.c @@ -129,7 +129,7 @@ static int acl_module_init(struct ldb_module *module) struct ldb_context *ldb; struct acl_private *data; int ret, i; - TALLOC_CTX *mem_ctx = talloc_new(module); + TALLOC_CTX *mem_ctx; static const char *attrs[] = { "passwordAttribute", NULL }; struct ldb_result *res; struct ldb_message *msg; @@ -154,6 +154,7 @@ static int acl_module_init(struct ldb_module *module) NULL, "acl", "perform", false); ldb_module_set_private(module, data); + mem_ctx = talloc_new(module); if (!mem_ctx) { return ldb_oom(ldb); }