diff options
author | 2016-01-26 17:56:20 -0800 | |
---|---|---|
committer | 2016-01-26 17:56:20 -0800 | |
commit | 17e630af30389dd2855740f8fecf5e09488c3d96 (patch) | |
tree | c79d076b52a7cba51a6816eaf78838478cfd8720 /src/cpp/util/byte_buffer.cc | |
parent | a00f998089a641ed7cc059eb5d4ce52734ba2e3e (diff) |
Fix a case in bbuf copy constructore
Diffstat (limited to 'src/cpp/util/byte_buffer.cc')
-rw-r--r-- | src/cpp/util/byte_buffer.cc | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cpp/util/byte_buffer.cc b/src/cpp/util/byte_buffer.cc index 2952f94b24..b9302d3cdc 100644 --- a/src/cpp/util/byte_buffer.cc +++ b/src/cpp/util/byte_buffer.cc @@ -85,7 +85,9 @@ ByteBuffer::ByteBuffer(const ByteBuffer& buf) ByteBuffer& ByteBuffer::operator=(const ByteBuffer& buf) { Clear(); // first remove existing data - buffer_ = grpc_byte_buffer_copy(buf.buffer_); // then copy + if (buf.buffer_) { + buffer_ = grpc_byte_buffer_copy(buf.buffer_); // then copy + } return *this; } |