summaryrefslogtreecommitdiffstats
path: root/source4/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-02-12 08:58:08 +0100
committerGünther Deschner <gd@samba.org>2014-02-13 11:54:15 +0100
commit8ccebf3a2749bf7c4f5e358b76e0eef7195f0f18 (patch)
treeb0d77fb2e0e8ce68894b2259e94a8ddd0e85c4e8 /source4/librpc/rpc
parentaa8b2d39a26641e1ad230a6c0e3b0fc09b9c4f95 (diff)
downloadsamba-8ccebf3a2749bf7c4f5e358b76e0eef7195f0f18.tar.gz
samba-8ccebf3a2749bf7c4f5e358b76e0eef7195f0f18.tar.xz
samba-8ccebf3a2749bf7c4f5e358b76e0eef7195f0f18.zip
s4:librpc/rpc: the table argument to dcerpc_epm_map_binding_send() isn't optional
We already dereference it unchecked later, so we can avoid some indentation. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Guenther Deschner <gd@samba.org>
Diffstat (limited to 'source4/librpc/rpc')
-rw-r--r--source4/librpc/rpc/dcerpc_util.c50
1 files changed, 23 insertions, 27 deletions
diff --git a/source4/librpc/rpc/dcerpc_util.c b/source4/librpc/rpc/dcerpc_util.c
index 70b73cdd275..aa2b13cc0c3 100644
--- a/source4/librpc/rpc/dcerpc_util.c
+++ b/source4/librpc/rpc/dcerpc_util.c
@@ -251,40 +251,36 @@ struct composite_context *dcerpc_epm_map_binding_send(TALLOC_CTX *mem_ctx,
/*
First, check if there is a default endpoint specified in the IDL
*/
- if (table != NULL) {
+ for (i = 0; i < table->endpoints->count; i++) {
struct dcerpc_binding *default_binding;
- /* Find one of the default pipes for this interface */
- for (i = 0; i < table->endpoints->count; i++) {
-
- status = dcerpc_parse_binding(s,
- table->endpoints->names[i],
- &default_binding);
- if (!NT_STATUS_IS_OK(status)) {
- continue;
- }
-
- if (binding->transport == NCA_UNKNOWN) {
- binding->transport = default_binding->transport;
- }
-
- if (default_binding->transport != binding->transport) {
- TALLOC_FREE(default_binding);
- continue;
- }
+ status = dcerpc_parse_binding(s,
+ table->endpoints->names[i],
+ &default_binding);
+ if (!NT_STATUS_IS_OK(status)) {
+ continue;
+ }
- if (default_binding->endpoint == NULL) {
- TALLOC_FREE(default_binding);
- continue;
- }
+ if (binding->transport == NCA_UNKNOWN) {
+ binding->transport = default_binding->transport;
+ }
- binding->endpoint = talloc_strdup(binding, default_binding->endpoint);
- if (composite_nomem(binding->endpoint, c)) return c;
+ if (default_binding->transport != binding->transport) {
TALLOC_FREE(default_binding);
+ continue;
+ }
- composite_done(c);
- return c;
+ if (default_binding->endpoint == NULL) {
+ TALLOC_FREE(default_binding);
+ continue;
}
+
+ binding->endpoint = talloc_strdup(binding, default_binding->endpoint);
+ if (composite_nomem(binding->endpoint, c)) return c;
+ TALLOC_FREE(default_binding);
+
+ composite_done(c);
+ return c;
}
/* anonymous credentials for rpc connection used to get endpoint mapping */