diff --git a/source/groupdb/mapping_ldb.c b/source/groupdb/mapping_ldb.c index 68e5b4c..e6cb6c4 100644 --- a/source/groupdb/mapping_ldb.c +++ b/source/groupdb/mapping_ldb.c @@ -277,8 +277,8 @@ static bool get_group_map_from_ntname(const char *name, GROUP_MAP *map) if (expr == NULL) goto failed; ret = ldb_search(ldb, NULL, LDB_SCOPE_SUBTREE, expr, NULL, &res); + if (ret != LDB_SUCCESS || (res && res->count != 1)) goto failed; talloc_steal(expr, res); - if (ret != LDB_SUCCESS || res->count != 1) goto failed; if (!msg_to_group_map(res->msgs[0], map)) goto failed;