From 2b8b7482abf5e98e091f910da979d552a3312fd2 Mon Sep 17 00:00:00 2001 From: yang-g Date: Fri, 23 Jun 2017 17:07:54 -0700 Subject: Destroy byte buffer to avoid leak in zombied calls --- src/core/lib/surface/server.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/lib/surface/server.c b/src/core/lib/surface/server.c index 8a2616b027..84ddf74ab9 100644 --- a/src/core/lib/surface/server.c +++ b/src/core/lib/surface/server.c @@ -475,6 +475,7 @@ static void publish_call(grpc_exec_ctx *exec_ctx, grpc_server *server, *rc->data.registered.deadline = calld->deadline; if (rc->data.registered.optional_payload) { *rc->data.registered.optional_payload = calld->payload; + calld->payload = NULL; } break; default: @@ -878,6 +879,7 @@ static void destroy_call_elem(grpc_exec_ctx *exec_ctx, grpc_call_element *elem, grpc_slice_unref_internal(exec_ctx, calld->path); } grpc_metadata_array_destroy(&calld->initial_metadata); + grpc_byte_buffer_destroy(calld->payload); gpr_mu_destroy(&calld->mu_state); -- cgit v1.2.3