summaryrefslogtreecommitdiff
path: root/source/lib/ldb/ldb_tdb/ldb_search.c
diff options
context:
space:
mode:
authorSimo Sorce <idra@samba.org>2006-03-03 22:52:57 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:52:14 -0500
commit7ef63abae12f65835a82f9931ad1f5ea75e5f3f6 (patch)
tree6d171d1aaf3f6712e7998794a14e2b7778e4b633 /source/lib/ldb/ldb_tdb/ldb_search.c
parent76cbab0e252620ef6591e2a7354484660bbb6df5 (diff)
downloadsamba-7ef63abae12f65835a82f9931ad1f5ea75e5f3f6.tar.gz
r13827: Minor enhancements or cosmetic changes
Diffstat (limited to 'source/lib/ldb/ldb_tdb/ldb_search.c')
-rw-r--r--source/lib/ldb/ldb_tdb/ldb_search.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/source/lib/ldb/ldb_tdb/ldb_search.c b/source/lib/ldb/ldb_tdb/ldb_search.c
index 5ffd45aa3b7..51550310550 100644
--- a/source/lib/ldb/ldb_tdb/ldb_search.c
+++ b/source/lib/ldb/ldb_tdb/ldb_search.c
@@ -522,7 +522,6 @@ int ltdb_search_async(struct ldb_module *module, const struct ldb_dn *base,
const char * const *attrs,
void *context,
int (*callback)(struct ldb_context *, void *, struct ldb_async_result *),
- int timeout,
struct ldb_async_handle **handle)
{
struct ltdb_private *ltdb = talloc_get_type(module->private_data, struct ltdb_private);
@@ -547,7 +546,7 @@ int ltdb_search_async(struct ldb_module *module, const struct ldb_dn *base,
return LDB_ERR_OPERATIONS_ERROR;
}
- *handle = init_ltdb_handle(ltdb, module, context, callback, timeout);
+ *handle = init_ltdb_handle(ltdb, module, context, callback);
if (*handle == NULL) {
talloc_free(*handle);
ltdb_unlock_read(module);
@@ -594,14 +593,17 @@ int ltdb_search_bytree(struct ldb_module *module, const struct ldb_dn *base,
ret = ltdb_search_async(module, base, scope, tree, attrs,
res, &ltdb_search_sync_callback,
- 0, &handle);
+ &handle);
- if (ret != LDB_SUCCESS)
- return ret;
+ if (ret == LDB_SUCCESS) {
+ ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+ talloc_free(handle);
+ }
- ret = ldb_async_wait(module->ldb, handle, LDB_WAIT_ALL);
+ if (ret != LDB_SUCCESS) {
+ talloc_free(*res);
+ }
- talloc_free(handle);
return ret;
}