Fixed memory leaks.

This commit is contained in:
Armin Novak 2014-11-17 00:36:01 +01:00
parent f34ee395eb
commit a2bbb265c1

View File

@ -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);