Skip to content

Commit

Permalink
qga-vss: Use the proper operator to free memory
Browse files Browse the repository at this point in the history
volume_name_wchar is allocated by 'void* operator new [](long long unsigned int)

Signed-off-by: Konstantin Kostiuk <kkostiuk@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-Id: <20220512154909.331481-1-kkostiuk@redhat.com>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
  • Loading branch information
kostyanf14 authored and bonzini committed May 14, 2022
1 parent 580ea13 commit 6c1d88c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions qga/vss-win32/requester.cpp
Expand Up @@ -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) {
Expand Down

0 comments on commit 6c1d88c

Please sign in to comment.