diff options
author | Craig Tiller <ctiller@google.com> | 2017-02-09 21:22:22 -0800 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-02-09 21:22:22 -0800 |
commit | c15d25a9dbc44c26b0755bb5078920db57c8afd7 (patch) | |
tree | 9b07cae37a26903f3e207e0ed26cedb37157b304 /src/core/lib/channel | |
parent | 2cecf27e2abd44adb46b34cf54042dfe04991547 (diff) |
Fix substitution
Diffstat (limited to 'src/core/lib/channel')
-rw-r--r-- | src/core/lib/channel/http_server_filter.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/core/lib/channel/http_server_filter.c b/src/core/lib/channel/http_server_filter.c index b475dd6b86..bb185351a8 100644 --- a/src/core/lib/channel/http_server_filter.c +++ b/src/core/lib/channel/http_server_filter.c @@ -199,13 +199,16 @@ static grpc_error *server_filter_incoming_metadata(grpc_exec_ctx *exec_ctx, } if (b->idx.named.host != NULL && b->idx.named.authority == NULL) { + grpc_linked_mdelem *el = b->idx.named.host; + grpc_mdelem md = GRPC_MDELEM_REF(el->md); + grpc_metadata_batch_remove(exec_ctx, b, el); add_error( error_name, &error, grpc_metadata_batch_add_head( - exec_ctx, b, b->idx.named.host, - grpc_mdelem_from_slices( - exec_ctx, GRPC_MDSTR_AUTHORITY, - grpc_slice_ref_internal(GRPC_MDVALUE(b->idx.named.host->md))))); + exec_ctx, b, el, grpc_mdelem_from_slices( + exec_ctx, GRPC_MDSTR_AUTHORITY, + grpc_slice_ref_internal(GRPC_MDVALUE(md))))); + GRPC_MDELEM_UNREF(exec_ctx, md); } if (b->idx.named.authority == NULL) { |