diff options
author | 2017-04-05 10:51:15 -0700 | |
---|---|---|
committer | 2017-04-05 10:51:15 -0700 | |
commit | 4723b71ee75d2834e4bff95fa49433e3f9e0e469 (patch) | |
tree | a7c0bb0975aa44c8881876bba74bf80309f342f7 /src | |
parent | 355c2ec37dbe86c9818ebf346907f567f921399b (diff) | |
parent | 61d02025b55030cdae26a72b001748af2a0d1424 (diff) |
Merge pull request #10459 from yang-g/missing_tail
Unref the tail, not the original slice
Diffstat (limited to 'src')
-rw-r--r-- | src/core/lib/security/transport/security_handshaker.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/core/lib/security/transport/security_handshaker.c b/src/core/lib/security/transport/security_handshaker.c index 2f39327670..509b4b556d 100644 --- a/src/core/lib/security/transport/security_handshaker.c +++ b/src/core/lib/security/transport/security_handshaker.c @@ -287,12 +287,11 @@ static void on_handshake_data_received_from_peer(grpc_exec_ctx *exec_ctx, if (num_left_overs > 0) { /* Put the leftovers in our buffer (ownership transfered). */ if (has_left_overs_in_current_slice) { - grpc_slice_buffer_add( - &h->left_overs, - grpc_slice_split_tail(&h->args->read_buffer->slices[i], - consumed_slice_size)); + grpc_slice tail = grpc_slice_split_tail(&h->args->read_buffer->slices[i], + consumed_slice_size); + grpc_slice_buffer_add(&h->left_overs, tail); /* 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( &h->left_overs, &h->args->read_buffer->slices[i + 1], |