mirror of https://github.com/FreeRDP/FreeRDP
Fixed memory leak.
This commit is contained in:
parent
458f948c7a
commit
c44f85c2b4
|
@ -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));
|
||||
|
||||
|
|
Loading…
Reference in New Issue