From 9be83eec1de2932946d61b774788ca18fb41e2fe Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 18 Feb 2015 14:16:15 -0800 Subject: Fix use-after-free. Transport and channel have different lifetimes, but share a metadata context. Make the metadata context ref counted, and have transport take a ref. --- src/core/surface/channel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/core/surface') diff --git a/src/core/surface/channel.c b/src/core/surface/channel.c index e308c60410..e38734c6a4 100644 --- a/src/core/surface/channel.c +++ b/src/core/surface/channel.c @@ -146,7 +146,7 @@ static void destroy_channel(void *p, int ok) { grpc_mdstr_unref(channel->grpc_message_string); grpc_mdstr_unref(channel->path_string); grpc_mdstr_unref(channel->authority_string); - grpc_mdctx_orphan(channel->metadata_context); + grpc_mdctx_unref(channel->metadata_context); gpr_free(channel); } -- cgit v1.2.3