From 6c1d88c72bd740cc431a13a02145168cf87866fc Mon Sep 17 00:00:00 2001 From: Konstantin Kostiuk Date: Thu, 12 May 2022 18:49:09 +0300 Subject: qga-vss: Use the proper operator to free memory volume_name_wchar is allocated by 'void* operator new [](long long unsigned int) Signed-off-by: Konstantin Kostiuk Reviewed-by: Marc-André Lureau Message-Id: <20220512154909.331481-1-kkostiuk@redhat.com> Signed-off-by: Paolo Bonzini --- qga/vss-win32/requester.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'qga') diff --git a/qga/vss-win32/requester.cpp b/qga/vss-win32/requester.cpp index 4513324dd2..b371affeab 100644 --- a/qga/vss-win32/requester.cpp +++ b/qga/vss-win32/requester.cpp @@ -354,12 +354,12 @@ void requester_freeze(int *num_vols, void *mountpoints, ErrorSet *errset) if (FAILED(hr)) { err_set(errset, hr, "failed to add %S to snapshot set", volume_name_wchar); - delete volume_name_wchar; + delete[] volume_name_wchar; goto out; } num_mount_points++; - delete volume_name_wchar; + delete[] volume_name_wchar; } if (num_mount_points == 0) { -- cgit v1.2.3-55-g7522