aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
diff options
context:
space:
mode:
authorGravatar Mark D. Roth <roth@google.com>2018-02-08 10:26:46 -0800
committerGravatar Mark D. Roth <roth@google.com>2018-02-08 10:26:46 -0800
commit209f644f047ccf8ab13b207ebb145dadc0d37a42 (patch)
tree60e67580c734d75a4761e2a0b300a1a976b226cb /src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
parent7bd5e18fea0201fed3edd74e3c3d7caf9040609c (diff)
Convert resolver API to C++.
Diffstat (limited to 'src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc')
-rw-r--r--src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
index 27c5b96a4c..d39c362cd3 100644
--- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
+++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.cc
@@ -161,13 +161,13 @@ static grpc_channel* client_channel_factory_create_channel(
return nullptr;
}
// Add channel arg containing the server URI.
- grpc_arg arg = grpc_channel_arg_string_create(
- (char*)GRPC_ARG_SERVER_URI,
- grpc_resolver_factory_add_default_prefix_if_needed(target));
+ grpc_core::UniquePtr<char> canonical_target =
+ grpc_core::ResolverRegistry::AddDefaultPrefixIfNeeded(target);
+ grpc_arg arg = grpc_channel_arg_string_create((char*)GRPC_ARG_SERVER_URI,
+ canonical_target.get());
const char* to_remove[] = {GRPC_ARG_SERVER_URI};
grpc_channel_args* new_args =
grpc_channel_args_copy_and_add_and_remove(args, to_remove, 1, &arg, 1);
- gpr_free(arg.value.string);
grpc_channel* channel =
grpc_channel_create(target, new_args, GRPC_CLIENT_CHANNEL, nullptr);
grpc_channel_args_destroy(new_args);