aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Yang Gao <yangg@google.com>2017-06-26 16:18:20 -0700
committerGravatar GitHub <noreply@github.com>2017-06-26 16:18:20 -0700
commit71a78e92cb9f6af405e6f80c9a31c408c4025095 (patch)
tree18d50234b9039c92831786989e239374d16f3127
parentbf527617bfa1d273d10a0982a02d6f5d8930109e (diff)
parent2b8b7482abf5e98e091f910da979d552a3312fd2 (diff)
Merge pull request #11590 from yang-g/zombie_paylod
Destroy byte buffer to avoid leak in zombied calls
-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);