summaryrefslogtreecommitdiff
path: root/librpc/rpc
diff options
context:
space:
mode:
authorStefan Metzmacher <metze@samba.org>2014-03-18 07:07:13 +0100
committerAndrew Bartlett <abartlet@samba.org>2014-03-25 00:45:28 +0100
commit002a0fb86e202b61879090f48f0c9513279c7500 (patch)
treef63be825beb61546c01ecd8df3e214603ef79bcc /librpc/rpc
parent7782fbe12b2228304bcddf9ff9949ef38597f8d8 (diff)
downloadsamba-002a0fb86e202b61879090f48f0c9513279c7500.tar.gz
librpc/rpc: use dcerpc_binding_set_string_option(b, "endpoint", NULL) to reset the endpoint
We should always go through just one code path to [re]set a value. Signed-off-by: Stefan Metzmacher <metze@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'librpc/rpc')
-rw-r--r--librpc/rpc/binding.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/librpc/rpc/binding.c b/librpc/rpc/binding.c
index 90787655bbc..c94bb838213 100644
--- a/librpc/rpc/binding.c
+++ b/librpc/rpc/binding.c
@@ -532,7 +532,7 @@ _PUBLIC_ enum dcerpc_transport_t dcerpc_binding_get_transport(const struct dcerp
_PUBLIC_ NTSTATUS dcerpc_binding_set_transport(struct dcerpc_binding *b,
enum dcerpc_transport_t transport)
{
- char *tmp = discard_const_p(char, b->endpoint);
+ NTSTATUS status;
/*
* TODO: we may want to check the transport value is
@@ -542,8 +542,6 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_transport(struct dcerpc_binding *b,
return NT_STATUS_OK;
}
- b->transport = transport;
-
/*
* This implicitly resets the endpoint
* as the endpoint is transport specific.
@@ -554,11 +552,14 @@ _PUBLIC_ NTSTATUS dcerpc_binding_set_transport(struct dcerpc_binding *b,
* TODO: in future we may reset more options
* here.
*/
- talloc_free(tmp);
- b->endpoint = NULL;
+ status = dcerpc_binding_set_string_option(b, "endpoint", NULL);
+ if (!NT_STATUS_IS_OK(status)) {
+ return status;
+ }
b->assoc_group_id = 0;
+ b->transport = transport;
return NT_STATUS_OK;
}