diff options
author | Craig Tiller <ctiller@google.com> | 2015-09-24 23:44:07 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-09-24 23:44:07 -0700 |
commit | 7db24e06e2d7676b181f74773abe4b5572bbb30d (patch) | |
tree | 184f1ffa2e4f0b869b59e4425986ffb23bf06c16 | |
parent | fc193e1ff40d1ae557caf84d644a1b3a9bfe95b3 (diff) |
Fix memory leak
-rw-r--r-- | src/core/iomgr/udp_server.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index e1a57b035f..ae7c889d0c 100644 --- a/src/core/iomgr/udp_server.c +++ b/src/core/iomgr/udp_server.c @@ -294,6 +294,7 @@ static int add_socket_to_server(grpc_udp_server *s, int fd, if (port >= 0) { grpc_sockaddr_to_string(&addr_str, (struct sockaddr *)&addr, 1); gpr_asprintf(&name, "udp-server-listener:%s", addr_str); + gpr_free(addr_str); gpr_mu_lock(&s->mu); /* append it to the list under a lock */ if (s->nports == s->port_capacity) { @@ -309,6 +310,7 @@ static int add_socket_to_server(grpc_udp_server *s, int fd, sp->read_cb = read_cb; GPR_ASSERT(sp->emfd); gpr_mu_unlock(&s->mu); + gpr_free(name); } return port; |