From 2de07761e071ccf09c0ea9e0fdc6a61303356549 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 16 Mar 2010 14:52:39 +1100 Subject: s4:dsdb Change dsdb_get_schema() callers to use new talloc argument This choses an appropriate talloc context to attach the schema too, long enough lived to ensure it does not go away before the operation compleates. Andrew Bartlett --- source4/dsdb/samdb/ldb_modules/linked_attributes.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'source4/dsdb/samdb/ldb_modules/linked_attributes.c') diff --git a/source4/dsdb/samdb/ldb_modules/linked_attributes.c b/source4/dsdb/samdb/ldb_modules/linked_attributes.c index 9bea7db31c..1e0a2b05f3 100644 --- a/source4/dsdb/samdb/ldb_modules/linked_attributes.c +++ b/source4/dsdb/samdb/ldb_modules/linked_attributes.c @@ -148,7 +148,7 @@ static int linked_attributes_rename(struct ldb_module *module, struct ldb_reques unsigned int i; int ret; struct ldb_context *ldb = ldb_module_get_ctx(module); - struct dsdb_schema *schema = dsdb_get_schema(ldb); + struct dsdb_schema *schema; /* - load the current msg - find any linked attributes @@ -160,6 +160,13 @@ static int linked_attributes_rename(struct ldb_module *module, struct ldb_reques if (ret != LDB_SUCCESS) { return ret; } + + schema = dsdb_get_schema(ldb, res); + if (!schema) { + ldb_oom(schema); + return LDB_ERR_OPERATIONS_ERROR; + } + msg = res->msgs[0]; for (i=0; inum_elements; i++) { -- cgit