aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/ext/client_channel/subchannel.c
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-27 15:58:23 -0800
committerGravatar GitHub <noreply@github.com>2017-02-27 15:58:23 -0800
commitcd232f64c634cba1e95b30db5d270114db6b1fc4 (patch)
treec009004932fc91897d8ae36c5183362f3c47af43 /src/core/ext/client_channel/subchannel.c
parent79ccb81b48433df9d56601663851a30de4ea8a6a (diff)
parentb4673fa9ec493deb4b7d2e811654812449f1077e (diff)
Merge pull request #9753 from ctiller/zalloc
Add zalloc, convert a bunch of files to use it
Diffstat (limited to 'src/core/ext/client_channel/subchannel.c')
-rw-r--r--src/core/ext/client_channel/subchannel.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/core/ext/client_channel/subchannel.c b/src/core/ext/client_channel/subchannel.c
index f2da148e49..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;
@@ -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 =