From 9f25ad44a93da09b3a7c14a4a1a0e78c5a1b529c Mon Sep 17 00:00:00 2001 From: Volker Lendecke Date: Thu, 6 Jun 2013 11:37:59 +0200 Subject: [PATCH] librpc: Shorten dcerpc_binding_handle_call a bit ... saves 200 bytes on 64 bit Linux with -O3 Signed-off-by: Volker Lendecke Reviewed-by: Stefan Metzmacher Autobuild-User(master): Stefan Metzmacher Autobuild-Date(master): Fri Jun 14 22:27:43 CEST 2013 on sn-devel-104 --- librpc/rpc/binding_handle.c | 19 ++++++------------- 1 file changed, 6 insertions(+), 13 deletions(-) diff --git a/librpc/rpc/binding_handle.c b/librpc/rpc/binding_handle.c index c3dc4731fbf..9354bbdc68e 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; } -- 2.11.4.GIT