diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-28 08:35:32 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-28 08:35:32 -0800 |
commit | c2515d0c64618eb2d4f7d7e87f2771014252a82a (patch) | |
tree | 453f3ef577f4f0e7f24d9b2e9b4a65c44e69b6b1 /src/core/ext/client_channel/subchannel.c | |
parent | 549c46b68fd9fdb3541691b20ec220f1dcbc076d (diff) | |
parent | cd232f64c634cba1e95b30db5d270114db6b1fc4 (diff) |
Merge github.com:grpc/grpc into always-use-port-server
Diffstat (limited to 'src/core/ext/client_channel/subchannel.c')
-rw-r--r-- | src/core/ext/client_channel/subchannel.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/core/ext/client_channel/subchannel.c b/src/core/ext/client_channel/subchannel.c index 09c68a91dd..cb2d2c821d 100644 --- a/src/core/ext/client_channel/subchannel.c +++ b/src/core/ext/client_channel/subchannel.c @@ -316,8 +316,7 @@ grpc_subchannel *grpc_subchannel_create(grpc_exec_ctx *exec_ctx, return c; } - c = gpr_malloc(sizeof(*c)); - memset(c, 0, sizeof(*c)); + c = gpr_zalloc(sizeof(*c)); c->key = key; gpr_atm_no_barrier_store(&c->ref_pair, 1 << INTERNAL_REF_BITS); c->connector = connector; @@ -438,7 +437,7 @@ static void on_external_state_watcher_done(grpc_exec_ctx *exec_ctx, void *arg, gpr_mu_unlock(&w->subchannel->mu); GRPC_SUBCHANNEL_WEAK_UNREF(exec_ctx, w->subchannel, "external_state_watcher"); gpr_free(w); - follow_up->cb(exec_ctx, follow_up->cb_arg, error); + grpc_closure_run(exec_ctx, follow_up, GRPC_ERROR_REF(error)); } static void on_alarm(grpc_exec_ctx *exec_ctx, void *arg, grpc_error *error) { @@ -765,7 +764,7 @@ grpc_error *grpc_connected_subchannel_create_call( grpc_polling_entity *pollent, grpc_slice path, gpr_timespec start_time, gpr_timespec deadline, grpc_subchannel_call **call) { grpc_channel_stack *chanstk = CHANNEL_STACK_FROM_CONNECTION(con); - *call = gpr_malloc(sizeof(grpc_subchannel_call) + chanstk->call_stack_size); + *call = gpr_zalloc(sizeof(grpc_subchannel_call) + chanstk->call_stack_size); grpc_call_stack *callstk = SUBCHANNEL_CALL_TO_CALL_STACK(*call); (*call)->connection = con; // Ref is added below. grpc_error *error = |