From d738a0448ddec6b1fb4491aabdf059ce837cb5ac Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 8 Nov 2010 10:58:28 +1100 Subject: s4-ldb: better error message when we try to register a module twice Pair-Programmed-With: Andrew Bartlett --- source4/lib/ldb/common/ldb_modules.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'source4') diff --git a/source4/lib/ldb/common/ldb_modules.c b/source4/lib/ldb/common/ldb_modules.c index 7de7cca989..ab06dc5788 100644 --- a/source4/lib/ldb/common/ldb_modules.c +++ b/source4/lib/ldb/common/ldb_modules.c @@ -272,11 +272,12 @@ static const struct ldb_module_ops *ldb_find_module_ops(const char *name) int ldb_register_module(const struct ldb_module_ops *ops) { - struct ops_list_entry *entry = talloc(talloc_autofree_context(), struct ops_list_entry); + struct ops_list_entry *entry; if (ldb_find_module_ops(ops->name) != NULL) - return -1; + return LDB_ERR_ENTRY_ALREADY_EXISTS; + entry = talloc(talloc_autofree_context(), struct ops_list_entry); if (entry == NULL) return -1; -- cgit