librpc: Shorten dcerpc_binding_handle_call a bit
authorVolker Lendecke <vl@samba.org>
Thu, 6 Jun 2013 09:37:59 +0000 (11:37 +0200)
committerStefan Metzmacher <metze@samba.org>
Fri, 14 Jun 2013 20:27:43 +0000 (22:27 +0200)
... saves 200 bytes on 64 bit Linux with -O3

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Fri Jun 14 22:27:43 CEST 2013 on sn-devel-104

librpc/rpc/binding_handle.c

index c3dc4731fbf55610a5988ea68110c2c6d17e5a48..9354bbdc68e67e4e43b32332ba69da62a76a3463 100644 (file)
@@ -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;
 }