aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/security/credentials/fake
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2017-02-16 14:09:39 -0800
committerGravatar Craig Tiller <ctiller@google.com>2017-02-16 14:09:39 -0800
commit6f4178878ccc45f365ce72eef6247315e048cf2a (patch)
tree91e01ba6e683014839aa60e22069713e6229c2c7 /src/core/lib/security/credentials/fake
parent1ca0dc2a9b22c144e2a5153394266037e497635e (diff)
Add zalloc, convert a bunch of files to use it
Diffstat (limited to 'src/core/lib/security/credentials/fake')
-rw-r--r--src/core/lib/security/credentials/fake/fake_credentials.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/core/lib/security/credentials/fake/fake_credentials.c b/src/core/lib/security/credentials/fake/fake_credentials.c
index a0629f76ce..68636ba208 100644
--- a/src/core/lib/security/credentials/fake/fake_credentials.c
+++ b/src/core/lib/security/credentials/fake/fake_credentials.c
@@ -71,8 +71,7 @@ static grpc_server_credentials_vtable
grpc_channel_credentials *grpc_fake_transport_security_credentials_create(
void) {
- grpc_channel_credentials *c = gpr_malloc(sizeof(grpc_channel_credentials));
- memset(c, 0, sizeof(grpc_channel_credentials));
+ grpc_channel_credentials *c = gpr_zalloc(sizeof(grpc_channel_credentials));
c->type = GRPC_CHANNEL_CREDENTIALS_TYPE_FAKE_TRANSPORT_SECURITY;
c->vtable = &fake_transport_security_credentials_vtable;
gpr_ref_init(&c->refcount, 1);
@@ -131,8 +130,7 @@ static grpc_call_credentials_vtable md_only_test_vtable = {
grpc_call_credentials *grpc_md_only_test_credentials_create(
const char *md_key, const char *md_value, int is_async) {
grpc_md_only_test_credentials *c =
- gpr_malloc(sizeof(grpc_md_only_test_credentials));
- memset(c, 0, sizeof(grpc_md_only_test_credentials));
+ gpr_zalloc(sizeof(grpc_md_only_test_credentials));
c->base.type = GRPC_CALL_CREDENTIALS_TYPE_OAUTH2;
c->base.vtable = &md_only_test_vtable;
gpr_ref_init(&c->base.refcount, 1);