yangzhg commented on a change in pull request #5706: URL: https://github.com/apache/incubator-doris/pull/5706#discussion_r619943438
########## File path: be/src/util/file_utils.cpp ########## @@ -240,16 +240,15 @@ Status FileUtils::copy_file(const std::string& src_path, const std::string& dest } const int64_t BUF_SIZE = 8192; - char* buf = new char[BUF_SIZE]; - DeferOp free_buf(std::bind<void>(std::default_delete<char[]>(), buf)); + std::unique_ptr<char[]> buf(new char[BUF_SIZE]); Review comment: std::unique_ptr<char[]> buf = `make_unique<char[]>(BUF_SIZE);` may be better -- 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. For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org