BePPPower commented on code in PR #15175:
URL: https://github.com/apache/doris/pull/15175#discussion_r1053056071
##########
be/src/io/fs/stream_load_pipe.cpp:
##########
@@ -132,25 +138,26 @@ Status
StreamLoadPipeReader::_read_next_buffer(std::unique_ptr<uint8_t[]>* data,
// finished
if (_buf_queue.empty()) {
DCHECK(_finished);
- data->reset();
- *length = 0;
+ // data->reset();
+ data = nullptr;
+ *bytes_read = 0;
return Status::OK();
}
auto buf = _buf_queue.front();
- *length = buf->remaining();
- data->reset(new uint8_t[*length]);
- buf->get_bytes((char*)(data->get()), *length);
+ *bytes_read = buf->remaining();
+ data = new char[*bytes_read];
Review Comment:
There are no leaks here because the data pointer is derived from the
unique_ptr of the external call(in NewJsonReader::_read_one_message() ).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]