Fixed memory leaks.

This commit is contained in:
Armin Novak 2014-11-16 23:00:13 +01:00
parent e8c7d97c9d
commit 07051fb3d1
1 changed files with 6 additions and 0 deletions

View File

@ -570,7 +570,10 @@ int gdi_CreateSurface(RdpgfxClientContext* context, RDPGFX_CREATE_SURFACE_PDU* c
surface->data = (BYTE*) calloc(1, surface->scanline * surface->height);
if (!surface->data)
{
free (surface);
return -1;
}
context->SetSurfaceData(context, surface->surfaceId, (void*) surface);
@ -737,7 +740,10 @@ int gdi_SurfaceToCache(RdpgfxClientContext* context, RDPGFX_SURFACE_TO_CACHE_PDU
cacheEntry->data = (BYTE*) calloc(1, cacheEntry->scanline * cacheEntry->height);
if (!cacheEntry->data)
{
free (cacheEntry);
return -1;
}
freerdp_image_copy(cacheEntry->data, cacheEntry->format, cacheEntry->scanline,
0, 0, cacheEntry->width, cacheEntry->height, surface->data,