aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/surface
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-02-18 14:16:15 -0800
committerGravatar Craig Tiller <ctiller@google.com>2015-02-18 14:16:15 -0800
commit9be83eec1de2932946d61b774788ca18fb41e2fe (patch)
treef8672252e92ceff39ee7eccc571c31a33cf548eb /src/core/surface
parentefad8fadd36899ff98ff616c349d181f2f1e4004 (diff)
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.
Diffstat (limited to 'src/core/surface')
-rw-r--r--src/core/surface/channel.c2
1 files changed, 1 insertions, 1 deletions
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);
}