diff options
author | Adam Michalik <xyzzyz@google.com> | 2016-06-08 10:59:48 -0700 |
---|---|---|
committer | Adam Michalik <xyzzyz@google.com> | 2016-06-08 10:59:48 -0700 |
commit | cfd4102357187823f82d44e561aaa1d5b9a9e3fe (patch) | |
tree | 073b7526b0c7dd629b4fdb1fa5bd6c03f29aaf35 | |
parent | 978f4a59fce4dfd1018b59b20913ed2a500bfbee (diff) |
fix memory leak
-rw-r--r-- | src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c index d625ed1d9e..96bf4d6f30 100644 --- a/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c +++ b/src/core/ext/transport/chttp2/server/insecure/server_chttp2_posix.c @@ -38,6 +38,7 @@ #ifdef GPR_SUPPORT_CHANNELS_FROM_FD +#include <grpc/support/alloc.h> #include <grpc/support/string_util.h> #include "src/core/ext/transport/chttp2/transport/chttp2_transport.h" @@ -52,12 +53,15 @@ void grpc_server_add_insecure_channel_from_fd(grpc_server *server, grpc_completion_queue *cq, int fd) { grpc_exec_ctx exec_ctx = GRPC_EXEC_CTX_INIT; + char *name; gpr_asprintf(&name, "fd:%d", fd); grpc_endpoint *server_endpoint = grpc_tcp_create( grpc_fd_create(fd, name), GRPC_TCP_DEFAULT_READ_SLICE_SIZE, name); + gpr_free(name); + const grpc_channel_args *server_args = grpc_server_get_channel_args(server); grpc_transport *transport = grpc_create_chttp2_transport( &exec_ctx, server_args, server_endpoint, 0 /* is_client */); |