Skip to content

Commit 17afb4d

Browse files
elizashurovYanVugenfirer
authored andcommitted
[viogpu] Fix delete[] on void* in VioGpuMemSegment::Close
m_pVAddr is a PVOID but is allocated as new BYTE[size]. Cast to PBYTE before delete[] to avoid undefined behavior. Signed-off-by: Elizabeth Ashurov <eashurov@redhat.com>
1 parent fb4a180 commit 17afb4d

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

viogpu/common/viogpu_queue.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ void VioGpuMemSegment::Close(void)
985985

986986
if (m_bSystemMemory)
987987
{
988-
delete[] m_pVAddr;
988+
delete[] reinterpret_cast<PBYTE>(m_pVAddr);
989989
}
990990
else
991991
{

0 commit comments

Comments
 (0)