From d672535551e794574d25a3f553011af5fbb7a0a9 Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Sat, 15 Jun 2013 20:39:53 +0200 Subject: libcli: Fix improper use of tevent_req_simple_recv_ntstatus tevent_req_simple_recv_ntstatus is just for the simple return without anything to do after it. Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- source4/libcli/finddcs_cldap.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) (limited to 'source4/libcli') 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, -- cgit