From 571f3e55b4a304cb50b211dd3492ce1664d5bf0c Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Wed, 6 Jul 2016 14:00:24 -0700 Subject: [PATCH] Prevent a use-after-free --- src/core/ext/transport/chttp2/transport/chttp2_transport.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/ext/transport/chttp2/transport/chttp2_transport.c b/src/core/ext/transport/chttp2/transport/chttp2_transport.c index 92722b50f4f..b58d93787d7 100644 --- a/src/core/ext/transport/chttp2/transport/chttp2_transport.c +++ b/src/core/ext/transport/chttp2/transport/chttp2_transport.c @@ -1178,6 +1178,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, true); } } else { + stream_global->send_initial_metadata = NULL; grpc_chttp2_complete_closure_step( exec_ctx, transport_global, stream_global, &stream_global->send_initial_metadata_finished, @@ -1233,6 +1234,7 @@ static void perform_stream_op_locked(grpc_exec_ctx *exec_ctx, grpc_chttp2_list_add_check_read_ops(transport_global, stream_global); } if (stream_global->write_closed) { + stream_global->send_trailing_metadata = NULL; grpc_chttp2_complete_closure_step( exec_ctx, transport_global, stream_global, &stream_global->send_trailing_metadata_finished,