diff options
-rw-r--r-- | librpc/rpc/binding_handle.c | 19 |
1 files changed, 6 insertions, 13 deletions
diff --git a/librpc/rpc/binding_handle.c b/librpc/rpc/binding_handle.c index c3dc4731fb..9354bbdc68 100644 --- a/librpc/rpc/binding_handle.c +++ b/librpc/rpc/binding_handle.c @@ -515,7 +515,7 @@ NTSTATUS dcerpc_binding_handle_call(struct dcerpc_binding_handle *h, TALLOC_CTX *frame = talloc_stackframe(); struct tevent_context *ev; struct tevent_req *subreq; - NTSTATUS status; + NTSTATUS status = NT_STATUS_NO_MEMORY; /* * TODO: allow only one sync call @@ -527,29 +527,22 @@ NTSTATUS dcerpc_binding_handle_call(struct dcerpc_binding_handle *h, ev = samba_tevent_context_init(frame); } if (ev == NULL) { - talloc_free(frame); - return NT_STATUS_NO_MEMORY; + goto fail; } subreq = dcerpc_binding_handle_call_send(frame, ev, h, object, table, opnum, r_mem, r_ptr); if (subreq == NULL) { - talloc_free(frame); - return NT_STATUS_NO_MEMORY; + goto fail; } if (!tevent_req_poll_ntstatus(subreq, ev, &status)) { - talloc_free(frame); - return status; + goto fail; } status = dcerpc_binding_handle_call_recv(subreq); - if (!NT_STATUS_IS_OK(status)) { - talloc_free(frame); - return status; - } - +fail: TALLOC_FREE(frame); - return NT_STATUS_OK; + return status; } |