1
0
mirror of https://github.com/samba-team/samba.git synced 2025-01-11 05:18:09 +03:00

rpc: Simplify dcerpc_binding_handle_raw_call()

Align it with dcerpc_binding_handle_call()

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jose A. Rivera <jarrpa@samba.org>

Autobuild-User(master): José A. Rivera <jarrpa@samba.org>
Autobuild-Date(master): Fri Jun 19 20:17:24 CEST 2015 on sn-devel-104
This commit is contained in:
Volker Lendecke 2015-02-14 16:30:33 +01:00 committed by José A. Rivera
parent 893b5f8144
commit f89e9bd47b

View File

@ -224,7 +224,7 @@ NTSTATUS dcerpc_binding_handle_raw_call(struct dcerpc_binding_handle *h,
TALLOC_CTX *frame = talloc_stackframe(); TALLOC_CTX *frame = talloc_stackframe();
struct tevent_context *ev; struct tevent_context *ev;
struct tevent_req *subreq; struct tevent_req *subreq;
NTSTATUS status; NTSTATUS status = NT_STATUS_NO_MEMORY;
/* /*
* TODO: allow only one sync call * TODO: allow only one sync call
@ -236,8 +236,7 @@ NTSTATUS dcerpc_binding_handle_raw_call(struct dcerpc_binding_handle *h,
ev = samba_tevent_context_init(frame); ev = samba_tevent_context_init(frame);
} }
if (ev == NULL) { if (ev == NULL) {
talloc_free(frame); goto fail;
return NT_STATUS_NO_MEMORY;
} }
subreq = dcerpc_binding_handle_raw_call_send(frame, ev, subreq = dcerpc_binding_handle_raw_call_send(frame, ev,
@ -246,13 +245,11 @@ NTSTATUS dcerpc_binding_handle_raw_call(struct dcerpc_binding_handle *h,
in_data, in_data,
in_length); in_length);
if (subreq == NULL) { if (subreq == NULL) {
talloc_free(frame); goto fail;
return NT_STATUS_NO_MEMORY;
} }
if (!tevent_req_poll_ntstatus(subreq, ev, &status)) { if (!tevent_req_poll_ntstatus(subreq, ev, &status)) {
talloc_free(frame); goto fail;
return status;
} }
status = dcerpc_binding_handle_raw_call_recv(subreq, status = dcerpc_binding_handle_raw_call_recv(subreq,
@ -260,13 +257,9 @@ NTSTATUS dcerpc_binding_handle_raw_call(struct dcerpc_binding_handle *h,
out_data, out_data,
out_length, out_length,
out_flags); out_flags);
if (!NT_STATUS_IS_OK(status)) { fail:
talloc_free(frame);
return status;
}
TALLOC_FREE(frame); TALLOC_FREE(frame);
return NT_STATUS_OK; return status;
} }
struct dcerpc_binding_handle_disconnect_state { struct dcerpc_binding_handle_disconnect_state {