fix memory leaks in disp server and gfx.c
This commit is contained in:
parent
47ca28b5c3
commit
2d9a50fafb
@ -275,7 +275,7 @@ static UINT disp_server_handle_messages(DispServerContext* context)
|
||||
WTSFreeMemory(buffer);
|
||||
}
|
||||
|
||||
/* Consume channel event only after the gfx dynamic channel is ready */
|
||||
/* Consume channel event only after the disp dynamic channel is ready */
|
||||
Stream_SetPosition(s, 0);
|
||||
|
||||
if (!WTSVirtualChannelRead(priv->disp_channel, 0, NULL, 0, &BytesReturned))
|
||||
@ -384,6 +384,7 @@ static UINT disp_server_open(DispServerContext* context)
|
||||
}
|
||||
|
||||
priv->SessionId = (DWORD)*pSessionId;
|
||||
WTSFreeMemory(pSessionId);
|
||||
priv->disp_channel = (HANDLE)WTSVirtualChannelOpenEx(priv->SessionId, DISP_DVC_CHANNEL_NAME,
|
||||
WTS_CHANNEL_OPTION_DYNAMIC);
|
||||
|
||||
@ -513,6 +514,12 @@ static UINT disp_server_close(DispServerContext* context)
|
||||
priv->stopEvent = NULL;
|
||||
}
|
||||
|
||||
if (priv->disp_channel)
|
||||
{
|
||||
WTSVirtualChannelClose(priv->disp_channel);
|
||||
priv->disp_channel = NULL;
|
||||
}
|
||||
|
||||
return error;
|
||||
}
|
||||
|
||||
|
@ -1214,6 +1214,7 @@ static UINT gdi_SurfaceToCache(RdpgfxClientContext* context,
|
||||
cacheEntry->width, cacheEntry->height, surface->data, surface->format,
|
||||
surface->scanline, rect->left, rect->top, NULL, FREERDP_FLIP_NONE))
|
||||
{
|
||||
free(cacheEntry->data);
|
||||
free(cacheEntry);
|
||||
goto fail;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user