]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: Fix unbalanced new[]/delete[] in read_bdev_label functions 59106/head
authorAdam Kupczyk <akupczyk@ibm.com>
Thu, 25 Jul 2024 12:42:43 +0000 (12:42 +0000)
committerPere Diaz Bou <pere-altea@hotmail.com>
Fri, 23 Aug 2024 09:49:25 +0000 (11:49 +0200)
Signed-off-by: Adam Kupczyk <akupczyk@ibm.com>
(cherry picked from commit 64f6b5d1d7ecab9f17d6d32424fdab536b7a5a93)

src/os/bluestore/BlueStore.cc

index 0f659d951b55a1489cc3ebf5c4fca7c6352e8c05..30023e81cb3463110e480066f5d3379e1628a891 100644 (file)
@@ -6583,7 +6583,7 @@ int BlueStore::_read_bdev_label(
   dout(10) << __func__ << " position=0x" << std::hex << disk_position << std::dec << dendl;
   ceph_assert(bdev);
   bufferlist bl;
-  unique_ptr<char> buf(new char[BDEV_LABEL_BLOCK_SIZE]);
+  unique_ptr<char[]> buf(new char[BDEV_LABEL_BLOCK_SIZE]);
   uint64_t dev_size = bdev->get_size();
   if (dev_size < disk_position + BDEV_LABEL_BLOCK_SIZE) {
     dout(10) << __func__ << " position=0x" << std::hex << disk_position