mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-12-14 03:59:36 +00:00
Fix double-free when handle is shrunk to zero size
This commit is contained in:
@@ -81,7 +81,7 @@ namespace PortabilityLayer
|
|||||||
if (newSize != hdl->m_size)
|
if (newSize != hdl->m_size)
|
||||||
{
|
{
|
||||||
void *newBuf = Realloc(hdl->m_contents, newSize);
|
void *newBuf = Realloc(hdl->m_contents, newSize);
|
||||||
if (!newBuf)
|
if (!newBuf && newSize != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
hdl->m_contents = newBuf;
|
hdl->m_contents = newBuf;
|
||||||
|
|||||||
Reference in New Issue
Block a user