diff options
-rw-r--r-- | source4/rpc_server/drsuapi/dcesrv_drsuapi.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c index 1d51ce879a..3512de60f5 100644 --- a/source4/rpc_server/drsuapi/dcesrv_drsuapi.c +++ b/source4/rpc_server/drsuapi/dcesrv_drsuapi.c @@ -576,14 +576,9 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta unsigned int i; *r->out.level_out = r->in.req->req1.level; - r->out.ctr = talloc(mem_ctx, union drsuapi_DsGetDCInfoCtr); + r->out.ctr = talloc_zero(mem_ctx, union drsuapi_DsGetDCInfoCtr); W_ERROR_HAVE_NO_MEMORY(r->out.ctr); - sites_dn = samdb_sites_dn(b_state->sam_ctx, mem_ctx); - if (!sites_dn) { - return WERR_DS_OBJ_NOT_FOUND; - } - switch (*r->out.level_out) { case -1: /* this level is not like the others */ @@ -598,6 +593,11 @@ static WERROR dcesrv_drsuapi_DsGetDomainControllerInfo_1(struct drsuapi_bind_sta return WERR_UNKNOWN_LEVEL; } + sites_dn = samdb_sites_dn(b_state->sam_ctx, mem_ctx); + if (!sites_dn) { + return WERR_DS_OBJ_NOT_FOUND; + } + ret = ldb_search(b_state->sam_ctx, mem_ctx, &res, sites_dn, LDB_SCOPE_SUBTREE, attrs, "objectClass=server"); |