From 50cea0183c9908e1d04ece6543e4344f3581f698 Mon Sep 17 00:00:00 2001
From: Makarand Dharmapurikar <makarandd@google.com>
Date: Thu, 23 Mar 2017 10:30:39 -0700
Subject: [PATCH] fixed asan memory leak ref issue

---
 src/core/lib/channel/http_client_filter.c | 2 +-
 src/core/lib/channel/http_server_filter.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/core/lib/channel/http_client_filter.c b/src/core/lib/channel/http_client_filter.c
index b69ab99704..347fc5c208 100644
--- a/src/core/lib/channel/http_client_filter.c
+++ b/src/core/lib/channel/http_client_filter.c
@@ -297,7 +297,7 @@ static grpc_error *hc_mutate_op(grpc_exec_ctx *exec_ctx,
         const int k_url_safe = 1;
         const int k_multi_line = 0;
         const char *k_query_separator = "?";
-        const size_t k_query_separator_len = GPR_ARRAY_SIZE(k_query_separator);
+        const size_t k_query_separator_len = 1; /* strlen(k_query_separator) */
 
         grpc_slice path_slice =
             GRPC_MDVALUE(op->send_initial_metadata->idx.named.path->md);
diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c
index 4ca4602cba..3bac5af883 100644
--- a/src/core/lib/channel/http_server_filter.c
+++ b/src/core/lib/channel/http_server_filter.c
@@ -214,7 +214,7 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx,
 
     /* substitute path metadata with just the path (not query) */
     grpc_mdelem mdelem_path_without_query = grpc_mdelem_from_slices(
-        exec_ctx, GRPC_MDSTR_PATH, grpc_slice_sub(path_slice, 0, offset));
+        exec_ctx, GRPC_MDSTR_PATH, grpc_slice_sub_no_ref(path_slice, 0, offset));
 
     grpc_metadata_batch_substitute(exec_ctx, b, b->idx.named.path,
                                    mdelem_path_without_query);
-- 
GitLab