_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
return NT_STATUS_OK;
}
- b->transport = transport;
-
/*
* This implicitly resets the endpoint
* as the endpoint is transport specific.
* 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;
}