mirror of
https://github.com/samba-team/samba.git
synced 2025-11-25 00:23:52 +03:00
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 commit is contained in:
committed by
Gerald (Jerry) Carter
parent
186766e309
commit
9890af534d
@@ -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) {
|
||||
|
||||
@@ -111,8 +111,8 @@ static int ejs_ldbSearch(MprVarHandle eid, int argc, struct MprVar **argv)
|
||||
mpr_Return(eid, mprCreateUndefinedVar());
|
||||
} else {
|
||||
mpr_Return(eid, mprLdbArray(ldb, res->msgs, res->count, "ldb_message"));
|
||||
talloc_free(res);
|
||||
}
|
||||
talloc_free(res);
|
||||
talloc_free(tmp_ctx);
|
||||
return 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user