summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/common/ldb_modules.c5
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;