From 269143fa0031ef0b6d801b47aab48ff3b1414565 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 13 Oct 2010 20:58:38 +1100 Subject: s4-ldb: take advantage of ldb_match_msg_error() in more places this gives better error checking --- source4/lib/ldb/ldb_tdb/ldb_search.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'source4/lib/ldb/ldb_tdb/ldb_search.c') diff --git a/source4/lib/ldb/ldb_tdb/ldb_search.c b/source4/lib/ldb/ldb_tdb/ldb_search.c index 9ebec90233..ca47fa3a5d 100644 --- a/source4/lib/ldb/ldb_tdb/ldb_search.c +++ b/source4/lib/ldb/ldb_tdb/ldb_search.c @@ -384,6 +384,7 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi struct ltdb_context *ac; struct ldb_message *msg; int ret; + bool matched; ac = talloc_get_type(state, struct ltdb_context); ldb = ldb_module_get_ctx(ac->module); @@ -415,8 +416,13 @@ static int search_func(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, voi } /* see if it matches the given expression */ - if (!ldb_match_msg(ldb, msg, - ac->tree, ac->base, ac->scope)) { + ret = ldb_match_msg_error(ldb, msg, + ac->tree, ac->base, ac->scope, &matched); + if (ret != LDB_SUCCESS) { + talloc_free(msg); + return -1; + } + if (!matched) { talloc_free(msg); return 0; } -- cgit