libcli: Fix improper use of tevent_req_simple_recv_ntstatus
authorVolker Lendecke <vl@samba.org>
Sat, 15 Jun 2013 18:39:53 +0000 (20:39 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Mon, 12 Aug 2013 05:25:58 +0000 (17:25 +1200)
tevent_req_simple_recv_ntstatus is just for the simple return without
anything to do after it.

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
source4/libcli/finddcs_cldap.c

index bf8da4e483e615d5044f990cd79dd501e6a26b76..ce0e1c7aa9e0f5a44aac15ae20b55fc23c739211 100644 (file)
@@ -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,