]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
schema_fsmo: only set module->private_data in case we keep the struct for a long...
authorStefan Metzmacher <metze@samba.org>
Mon, 30 Jun 2008 15:15:49 +0000 (17:15 +0200)
committerStefan Metzmacher <metze@samba.org>
Mon, 30 Jun 2008 15:40:01 +0000 (17:40 +0200)
metze

source/dsdb/samdb/ldb_modules/schema_fsmo.c

index 8ceeba98048c3ac38771bf8a838a265a87367193..bc1e60abb27c901e1bcd800c9b806d21912209fc 100644 (file)
@@ -54,6 +54,8 @@ static int schema_fsmo_init(struct ldb_module *module)
                NULL
        };
 
+       module->private_data = NULL;
+
        if (dsdb_get_schema(module->ldb)) {
                return ldb_next_init(module);
        }
@@ -77,7 +79,6 @@ static int schema_fsmo_init(struct ldb_module *module)
                ldb_oom(module->ldb);
                return LDB_ERR_OPERATIONS_ERROR;
        }
-       module->private_data = schema_fsmo;
 
        schema = dsdb_new_schema(mem_ctx, lp_iconv_convenience(ldb_get_opaque(module->ldb, "loadparm")));
        if (!schema) {
@@ -246,7 +247,7 @@ static int schema_fsmo_init(struct ldb_module *module)
                return LDB_ERR_OPERATIONS_ERROR;
        }
 
-       talloc_steal(module, schema_fsmo);
+       module->private_data = talloc_steal(module, schema_fsmo);
 
        ldb_debug(module->ldb, LDB_DEBUG_TRACE,
                          "schema_fsmo_init: we are master: %s\n",