fix use after free

This commit is contained in:
Sema Checherinda 2024-11-25 13:15:02 +01:00
parent 4c55f0c38d
commit 132360aa24

View File

@ -770,7 +770,7 @@ std::unique_ptr<WriteBufferFromFileBase> DiskObjectStorageTransaction::writeFile
{
auto write_operation = std::make_unique<WriteFileObjectStorageOperation>(object_storage, metadata_storage, object);
create_metadata_callback = [object_storage_tx = shared_from_this(), write_op = write_operation.get(), mode, path, key_ = std::move(object_key)](size_t count)
create_metadata_callback = [object_storage_tx = shared_from_this(), write_op = std::move(write_operation), mode, path, key_ = std::move(object_key)](size_t count)
{
/// This callback called in WriteBuffer finalize method -- only there we actually know
/// how many bytes were written. We don't control when this finalize method will be called