From 00781404fc506c627577547626a81fcc259f14d6 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Fri, 21 Jul 2017 13:22:20 -0700 Subject: [PATCH] layers: Fix mismatched new[] / delete Likely benign on anything reasonable, but still UB. --- layers/core_validation_types.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/layers/core_validation_types.h b/layers/core_validation_types.h index 53c3213..606eb84 100644 --- a/layers/core_validation_types.h +++ b/layers/core_validation_types.h @@ -233,7 +233,7 @@ class BUFFER_STATE : public BINDABLE { ~BUFFER_STATE() { if ((createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) && (createInfo.queueFamilyIndexCount > 0)) { - delete createInfo.pQueueFamilyIndices; + delete [] createInfo.pQueueFamilyIndices; createInfo.pQueueFamilyIndices = nullptr; } }; @@ -281,7 +281,7 @@ class IMAGE_STATE : public BINDABLE { ~IMAGE_STATE() { if ((createInfo.sharingMode == VK_SHARING_MODE_CONCURRENT) && (createInfo.queueFamilyIndexCount > 0)) { - delete createInfo.pQueueFamilyIndices; + delete [] createInfo.pQueueFamilyIndices; createInfo.pQueueFamilyIndices = nullptr; } }; -- 2.7.4