Skip to content
Snippets Groups Projects
Commit 4723b71e authored by Yang Gao's avatar Yang Gao Committed by GitHub
Browse files

Merge pull request #10459 from yang-g/missing_tail

Unref the tail, not the original slice
parents 355c2ec3 61d02025
No related branches found
No related tags found
No related merge requests found
...@@ -287,12 +287,11 @@ static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx, ...@@ -287,12 +287,11 @@ static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx,
if (num_left_overs > 0) { if (num_left_overs > 0) {
/* Put the leftovers in our buffer (ownership transfered). */ /* Put the leftovers in our buffer (ownership transfered). */
if (has_left_overs_in_current_slice) { if (has_left_overs_in_current_slice) {
grpc_slice_buffer_add( grpc_slice tail = grpc_slice_split_tail(&h->args->read_buffer->slices[i],
&h->left_overs, consumed_slice_size);
grpc_slice_split_tail(&h->args->read_buffer->slices[i], grpc_slice_buffer_add(&h->left_overs, tail);
consumed_slice_size));
/* split_tail above increments refcount. */ /* split_tail above increments refcount. */
grpc_slice_unref_internal(exec_ctx, h->args->read_buffer->slices[i]); grpc_slice_unref_internal(exec_ctx, tail);
} }
grpc_slice_buffer_addn( grpc_slice_buffer_addn(
&h->left_overs, &h->args->read_buffer->slices[i + 1], &h->left_overs, &h->args->read_buffer->slices[i + 1],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment