aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/lib/surface
diff options
context:
space:
mode:
authorGravatar yang-g <yangg@google.com>2017-06-23 17:07:54 -0700
committerGravatar yang-g <yangg@google.com>2017-06-23 17:07:54 -0700
commit2b8b7482abf5e98e091f910da979d552a3312fd2 (patch)
treefb11a9fe1821709257b9321375a230aa5a5a6770 /src/core/lib/surface
parentb9fc05bf934f192be47b1d0495b0840dcedac6d2 (diff)
Destroy byte buffer to avoid leak in zombied calls
Diffstat (limited to 'src/core/lib/surface')
-rw-r--r--src/core/lib/surface/server.c2
1 files changed, 2 insertions, 0 deletions
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);