mirror of
https://github.com/apache/arrow.git
synced 2026-10-29 09:05:47 +08:00
fix io/memory.cc asan
This commit is contained in:
1 parent
19ee908d72
commit
bba5824c4a
1 file changed
+5
-3
@@ -100,9 +100,11 @@ Status BufferOutputStream::Write(const void* data, int64_t nbytes) {
|
||||
return Status::IOError("OutputStream is closed");
|
||||
}
|
||||
DCHECK(buffer_);
|
||||
RETURN_NOT_OK(Reserve(nbytes));
|
||||
memcpy(mutable_data_ + position_, data, nbytes);
|
||||
position_ += nbytes;
|
||||
if (ARROW_PREDICT_TRUE(nbytes > 0)) {
|
||||
RETURN_NOT_OK(Reserve(nbytes));
|
||||
memcpy(mutable_data_ + position_, data, nbytes);
|
||||
position_ += nbytes;
|
||||
}
|
||||
return Status::OK();
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user