diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-16 14:09:39 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-16 14:09:39 -0800 |
commit | 6f4178878ccc45f365ce72eef6247315e048cf2a (patch) | |
tree | 91e01ba6e683014839aa60e22069713e6229c2c7 /src/core/ext/resolver | |
parent | 1ca0dc2a9b22c144e2a5153394266037e497635e (diff) |
Add zalloc, convert a bunch of files to use it
Diffstat (limited to 'src/core/ext/resolver')
-rw-r--r-- | src/core/ext/resolver/dns/native/dns_resolver.c | 3 | ||||
-rw-r--r-- | src/core/ext/resolver/sockaddr/sockaddr_resolver.c | 3 |
2 files changed, 2 insertions, 4 deletions
diff --git a/src/core/ext/resolver/dns/native/dns_resolver.c b/src/core/ext/resolver/dns/native/dns_resolver.c index 2c9623211b..264b2fc347 100644 --- a/src/core/ext/resolver/dns/native/dns_resolver.c +++ b/src/core/ext/resolver/dns/native/dns_resolver.c @@ -262,8 +262,7 @@ static grpc_resolver *dns_create(grpc_exec_ctx *exec_ctx, char *path = args->uri->path; if (path[0] == '/') ++path; // Create resolver. - dns_resolver *r = gpr_malloc(sizeof(dns_resolver)); - memset(r, 0, sizeof(*r)); + dns_resolver *r = gpr_zalloc(sizeof(dns_resolver)); gpr_mu_init(&r->mu); grpc_resolver_init(&r->base, &dns_resolver_vtable); r->name_to_resolve = gpr_strdup(path); diff --git a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c index a1365f6465..e904141778 100644 --- a/src/core/ext/resolver/sockaddr/sockaddr_resolver.c +++ b/src/core/ext/resolver/sockaddr/sockaddr_resolver.c @@ -197,8 +197,7 @@ static grpc_resolver *sockaddr_create(grpc_exec_ctx *exec_ctx, return NULL; } /* Instantiate resolver. */ - sockaddr_resolver *r = gpr_malloc(sizeof(sockaddr_resolver)); - memset(r, 0, sizeof(*r)); + sockaddr_resolver *r = gpr_zalloc(sizeof(sockaddr_resolver)); r->addresses = addresses; r->channel_args = grpc_channel_args_copy(args->args); gpr_mu_init(&r->mu); |