From 89f1c7277928f6f222b4f2c6ec2dff71bacbbe68 Mon Sep 17 00:00:00 2001
From: yang-g <yangg@google.com>
Date: Tue, 6 Oct 2015 13:34:37 -0700
Subject: [PATCH] unref slice before cancel

---
 src/core/surface/call.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/core/surface/call.c b/src/core/surface/call.c
index d15a3bcbad..786535a579 100644
--- a/src/core/surface/call.c
+++ b/src/core/surface/call.c
@@ -927,6 +927,7 @@ static int add_slice_to_message(grpc_call *call, gpr_slice slice) {
   }
   /* we have to be reading a message to know what to do here */
   if (!call->reading_message) {
+    gpr_slice_unref(slice);
     cancel_with_status(call, GRPC_STATUS_INVALID_ARGUMENT,
                        "Received payload data while not reading a message");
     return 0;
-- 
GitLab