diff options
author | murgatroid99 <mlumish@google.com> | 2017-07-07 14:44:56 -0700 |
---|---|---|
committer | murgatroid99 <mlumish@google.com> | 2017-07-10 10:07:07 -0700 |
commit | cd4508f944c596bea79f1f19fab761272703c5e4 (patch) | |
tree | 95b5117242d9f1471e75bc13c97166e537b66643 /src/core/lib/iomgr/resolve_address_uv.c | |
parent | 4e014a241011356c8c03c45c86b88bf5f012d8d1 (diff) |
Fix some memory leaks in UV TCP code
Diffstat (limited to 'src/core/lib/iomgr/resolve_address_uv.c')
-rw-r--r-- | src/core/lib/iomgr/resolve_address_uv.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/core/lib/iomgr/resolve_address_uv.c b/src/core/lib/iomgr/resolve_address_uv.c index 45de289e45..a98b8e62db 100644 --- a/src/core/lib/iomgr/resolve_address_uv.c +++ b/src/core/lib/iomgr/resolve_address_uv.c @@ -54,7 +54,7 @@ static int retry_named_port_failure(int status, request *r, int retry_status; uv_getaddrinfo_t *req = gpr_malloc(sizeof(uv_getaddrinfo_t)); req->data = r; - r->port = svc[i][1]; + r->port = gpr_strdup(svc[i][1]); retry_status = uv_getaddrinfo(uv_default_loop(), req, getaddrinfo_cb, r->host, r->port, r->hints); if (retry_status < 0 || getaddrinfo_cb == NULL) { @@ -127,6 +127,8 @@ static void getaddrinfo_callback(uv_getaddrinfo_t *req, int status, GRPC_CLOSURE_SCHED(&exec_ctx, r->on_done, error); grpc_exec_ctx_finish(&exec_ctx); gpr_free(r->hints); + gpr_free(r->host); + gpr_free(r->port); gpr_free(r); uv_freeaddrinfo(res); } |