summaryrefslogtreecommitdiff
path: root/source4/lib
diff options
context:
space:
mode:
authorMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 14:26:37 +0200
committerMatthias Dieter Wallnöfer <mdw@samba.org>2010-10-20 12:31:05 +0000
commit3bf8ca67900a10e608808535358a148455827a2e (patch)
tree4018366e2acfef39c8aff13c78f70cc8b50a814e /source4/lib
parentec43a4d29e3bb395e7a8d7edafb6dedfeb9baec2 (diff)
downloadsamba-3bf8ca67900a10e608808535358a148455827a2e.tar.gz
samba-3bf8ca67900a10e608808535358a148455827a2e.tar.bz2
samba-3bf8ca67900a10e608808535358a148455827a2e.zip
ldb:ldb_index.c - let "ldb_module_oom" generate the return code
Diffstat (limited to 'source4/lib')
-rw-r--r--source4/lib/ldb/ldb_tdb/ldb_index.c23
1 files changed, 8 insertions, 15 deletions
diff --git a/source4/lib/ldb/ldb_tdb/ldb_index.c b/source4/lib/ldb/ldb_tdb/ldb_index.c
index db49455745..fc2d9a05aa 100644
--- a/source4/lib/ldb/ldb_tdb/ldb_index.c
+++ b/source4/lib/ldb/ldb_tdb/ldb_index.c
@@ -217,15 +217,13 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn,
msg = ldb_msg_new(module);
if (!msg) {
- ldb_module_oom(module);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
ret = ldb_msg_add_fmt(msg, LTDB_IDXVERSION, "%u", LTDB_INDEXING_VERSION);
if (ret != LDB_SUCCESS) {
talloc_free(msg);
- ldb_module_oom(module);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
msg->dn = dn;
@@ -234,9 +232,8 @@ static int ltdb_dn_list_store_full(struct ldb_module *module, struct ldb_dn *dn,
ret = ldb_msg_add_empty(msg, LTDB_IDX, LDB_FLAG_MOD_ADD, &el);
if (ret != LDB_SUCCESS) {
- ldb_module_oom(module);
talloc_free(msg);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
el->values = list->dn;
el->num_values = list->count;
@@ -347,13 +344,13 @@ int ltdb_index_transaction_commit(struct ldb_module *module)
struct ldb_context *ldb = ldb_module_get_ctx(module);
ldb_reset_err_string(ldb);
+
if (ltdb->idxptr->itdb) {
tdb_traverse(ltdb->idxptr->itdb, ltdb_index_traverse_store, module);
tdb_close(ltdb->idxptr->itdb);
}
ret = ltdb->idxptr->error;
-
if (ret != LDB_SUCCESS) {
if (!ldb_errstring(ldb)) {
ldb_set_errstring(ldb, ldb_strerror(ret));
@@ -774,8 +771,7 @@ static int ltdb_index_dn_and(struct ldb_module *module,
list2 = talloc_zero(list, struct dn_list);
if (list2 == NULL) {
- ldb_module_oom(module);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(module);
}
ret = ltdb_index_dn(module, subtree, index_list, list2);
@@ -1023,23 +1019,20 @@ int ltdb_search_indexed(struct ltdb_context *ac, uint32_t *match_count)
dn_list = talloc_zero(ac, struct dn_list);
if (dn_list == NULL) {
- ldb_module_oom(ac->module);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(ac->module);
}
switch (ac->scope) {
case LDB_SCOPE_BASE:
dn_list->dn = talloc_array(dn_list, struct ldb_val, 1);
if (dn_list->dn == NULL) {
- ldb_module_oom(ac->module);
talloc_free(dn_list);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(ac->module);
}
dn_list->dn[0].data = discard_const_p(unsigned char, ldb_dn_get_linearized(ac->base));
if (dn_list->dn[0].data == NULL) {
- ldb_module_oom(ac->module);
talloc_free(dn_list);
- return LDB_ERR_OPERATIONS_ERROR;
+ return ldb_module_oom(ac->module);
}
dn_list->dn[0].length = strlen((char *)dn_list->dn[0].data);
dn_list->count = 1;