talloc_free(req);
return NT_STATUS_INTERNAL_ERROR;
}
- status = tevent_req_simple_recv_ntstatus(req);
- if (NT_STATUS_IS_OK(status)) {
- talloc_steal(mem_ctx, state->netlogon);
- io->out.netlogon = state->netlogon->out.netlogon;
- io->out.address = talloc_steal(mem_ctx, state->srv_addresses[state->srv_address_index]);
+ if (tevent_req_is_nterror(req, &status)) {
+ tevent_req_received(req);
+ return status;
}
+
+ talloc_steal(mem_ctx, state->netlogon);
+ io->out.netlogon = state->netlogon->out.netlogon;
+ io->out.address = talloc_steal(
+ mem_ctx, state->srv_addresses[state->srv_address_index]);
+
tevent_req_received(req);
- return status;
+ return NT_STATUS_OK;
}
NTSTATUS finddcs_cldap(TALLOC_CTX *mem_ctx,