From 7db24e06e2d7676b181f74773abe4b5572bbb30d Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 24 Sep 2015 23:44:07 -0700 Subject: [PATCH] Fix memory leak --- src/core/iomgr/udp_server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/iomgr/udp_server.c b/src/core/iomgr/udp_server.c index e1a57b035fa..ae7c889d0c6 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;