diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc index 4c4772a92b30d..91ed66b7663d5 100644 --- a/src/cpp/util/byte_buffer.cc +++ b/src/cpp/util/byte_buffer.cc @@ -104,8 +104,8 @@ ByteBuffer& ByteBuffer::operator=(const ByteBuffer& buf) { void ByteBuffer::Swap(ByteBuffer* other) { grpc_byte_buffer* tmp = other->buffer_; - other->buffer_ = this->buffer_; - this->buffer_ = tmp; + other->buffer_ = buffer_; + buffer_ = tmp; } } // namespace grpc