fix: segv if the LoadArrowReaderFromRemote run at the exception path (#41071)

issue: #41067
pr: #41069

Signed-off-by: chyezh <chyezh@outlook.com>
pull/41080/head
Zhen Ye 2025-04-03 02:14:21 +08:00 committed by GitHub
parent 37a533fe6d
commit 8065c801f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -879,7 +879,7 @@ LoadArrowReaderFromRemote(const std::vector<std::string>& remote_files,
futures;
futures.reserve(remote_files.size());
for (const auto& file : remote_files) {
auto future = pool.Submit([&]() {
auto future = pool.Submit([rcm, file]() {
auto fileSize = rcm->Size(file);
auto buf = std::shared_ptr<uint8_t[]>(new uint8_t[fileSize]);
rcm->Read(file, buf.get(), fileSize);