Fixed memory leaks.
This commit is contained in:
parent
f34ee395eb
commit
a2bbb265c1
@ -555,7 +555,10 @@ int xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* cr
|
||||
surface->data = (BYTE*) _aligned_malloc(size, 16);
|
||||
|
||||
if (!surface->data)
|
||||
{
|
||||
free (surface);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZeroMemory(surface->data, size);
|
||||
|
||||
@ -574,7 +577,11 @@ int xf_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* cr
|
||||
surface->stage = (BYTE*) _aligned_malloc(size, 16);
|
||||
|
||||
if (!surface->stage)
|
||||
{
|
||||
free (surface->data);
|
||||
free (surface);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZeroMemory(surface->stage, size);
|
||||
|
||||
@ -749,7 +756,10 @@ int xf_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU*
|
||||
cacheEntry->data = (BYTE*) _aligned_malloc(size, 16);
|
||||
|
||||
if (!cacheEntry->data)
|
||||
{
|
||||
free (cacheEntry);
|
||||
return -1;
|
||||
}
|
||||
|
||||
ZeroMemory(cacheEntry->data, size);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user