summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/libcli/finddcs_cldap.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/source4/libcli/finddcs_cldap.c b/source4/libcli/finddcs_cldap.c
index bf8da4e483..ce0e1c7aa9 100644
--- a/source4/libcli/finddcs_cldap.c
+++ b/source4/libcli/finddcs_cldap.c
@@ -431,14 +431,18 @@ NTSTATUS finddcs_cldap_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx, struct
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,