From 132360aa24931e8ab88ed8110c3d8e4c5260ecc2 Mon Sep 17 00:00:00 2001 From: Sema Checherinda Date: Mon, 25 Nov 2024 13:15:02 +0100 Subject: [PATCH] fix use after free --- src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp index 19de2bb78af..0c9003360f6 100644 --- a/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp +++ b/src/Disks/ObjectStorages/DiskObjectStorageTransaction.cpp @@ -770,7 +770,7 @@ std::unique_ptr DiskObjectStorageTransaction::writeFile { auto write_operation = std::make_unique(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