From f9b56b93f76f50c85b1897f2732d1a5bbf6727b1 Mon Sep 17 00:00:00 2001 From: "Mark D. Roth" Date: Wed, 16 Nov 2016 14:58:05 -0800 Subject: Change grpc_handshaker_args to be owned by the handshake manager. Also clean up hand-off semantics of endpoints. --- src/core/ext/transport/chttp2/client/insecure/channel_create.c | 2 +- src/core/ext/transport/chttp2/client/secure/secure_channel_create.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src/core/ext/transport/chttp2/client') diff --git a/src/core/ext/transport/chttp2/client/insecure/channel_create.c b/src/core/ext/transport/chttp2/client/insecure/channel_create.c index c4c1e638a9..e0bce57fc2 100644 --- a/src/core/ext/transport/chttp2/client/insecure/channel_create.c +++ b/src/core/ext/transport/chttp2/client/insecure/channel_create.c @@ -97,6 +97,7 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, grpc_handshaker_args *args = arg; connector *c = args->user_data; if (error != GRPC_ERROR_NONE) { + grpc_endpoint_destroy(exec_ctx, args->endpoint); grpc_channel_args_destroy(args->args); gpr_free(args->read_buffer); } else { @@ -107,7 +108,6 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, args->read_buffer); c->result->channel_args = args->args; } - gpr_free(args); grpc_closure *notify = c->notify; c->notify = NULL; grpc_exec_ctx_sched(exec_ctx, notify, GRPC_ERROR_REF(error), NULL); diff --git a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c index 5101737e11..4182aa730f 100644 --- a/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c +++ b/src/core/ext/transport/chttp2/client/secure/secure_channel_create.c @@ -135,6 +135,7 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, connector *c = args->user_data; c->tmp_args = args->args; if (error != GRPC_ERROR_NONE) { + grpc_endpoint_destroy(exec_ctx, args->endpoint); gpr_free(args->read_buffer); grpc_closure *notify = c->notify; c->notify = NULL; @@ -147,7 +148,6 @@ static void on_handshake_done(grpc_exec_ctx *exec_ctx, void *arg, exec_ctx, c->security_connector, args->endpoint, args->read_buffer, c->args.deadline, on_secure_handshake_done, c); } - gpr_free(args); } static void on_initial_connect_string_sent(grpc_exec_ctx *exec_ctx, void *arg, -- cgit v1.2.3