From 84138215cade4bd427a4a04810696cbb89434928 Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Thu, 16 Nov 2006 09:34:19 +0000 Subject: r19732: The 'res' from ldb_search is only valid if the call returns LDB_SUCCESS. This seems to show up (as an abort() from talloc) particularly under ldb_ildap. Andrew Bartlett (This used to be commit 9890af534d845d471d2a98268c408a907b29e016) --- source4/dsdb/samdb/ldb_modules/samldb.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'source4/dsdb/samdb') diff --git a/source4/dsdb/samdb/ldb_modules/samldb.c b/source4/dsdb/samdb/ldb_modules/samldb.c index e86a3bfde4..3ce5cc1b5c 100644 --- a/source4/dsdb/samdb/ldb_modules/samldb.c +++ b/source4/dsdb/samdb/ldb_modules/samldb.c @@ -200,9 +200,12 @@ static struct ldb_dn *samldb_search_domain(struct ldb_module *module, TALLOC_CTX do { ret = ldb_search(module->ldb, sdn, LDB_SCOPE_BASE, "(|(objectClass=domain)(objectClass=builtinDomain))", attrs, &res); - talloc_steal(local_ctx, res); - if (ret == LDB_SUCCESS && res->count == 1) - break; + if (ret == LDB_SUCCESS) { + talloc_steal(local_ctx, res); + if (res->count == 1) { + break; + } + } } while ((sdn = ldb_dn_get_parent(local_ctx, sdn))); if (ret != LDB_SUCCESS || res->count != 1) { -- cgit