diff options
author | Andrew Tridgell <tridge@samba.org> | 2010-11-08 10:58:28 +1100 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 2010-11-08 11:13:28 +1100 |
commit | d738a0448ddec6b1fb4491aabdf059ce837cb5ac (patch) | |
tree | d97324f0d1eb90be505ab9a3e3d18e1afacfd685 | |
parent | cc5e23135560f1f298a58ef59ee87f1c195d1854 (diff) | |
download | samba-d738a0448ddec6b1fb4491aabdf059ce837cb5ac.tar.gz samba-d738a0448ddec6b1fb4491aabdf059ce837cb5ac.tar.bz2 samba-d738a0448ddec6b1fb4491aabdf059ce837cb5ac.zip |
s4-ldb: better error message when we try to register a module twice
Pair-Programmed-With: Andrew Bartlett <abartlet@samba.org>
-rw-r--r-- | source4/lib/ldb/common/ldb_modules.c | 5 |
1 files changed, 3 insertions, 2 deletions
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; |