Fixed memory leak.

This commit is contained in:
Armin Novak 2014-11-17 00:42:05 +01:00
parent 458f948c7a
commit c44f85c2b4
1 changed files with 7 additions and 0 deletions

View File

@ -44,12 +44,19 @@ rdpShadowSurface* shadow_surface_new(rdpShadowServer* server, int x, int y, int
surface->data = (BYTE*) malloc(surface->scanline * surface->height);
if (!surface->data)
{
free (surface);
return NULL;
}
ZeroMemory(surface->data, surface->scanline * surface->height);
if (!InitializeCriticalSectionAndSpinCount(&(surface->lock), 4000))
{
free (surface->data);
free (surface);
return NULL;
}
region16_init(&(surface->invalidRegion));