server/proxy: Fix rdpgfx and events leak

This commit is contained in:
kubistika 2019-05-28 16:10:04 +03:00 committed by akallabeth
parent c0cece1064
commit 255fab201a
2 changed files with 20 additions and 3 deletions

View File

@ -44,8 +44,16 @@ static void client_to_proxy_context_free(freerdp_peer* client,
{
WINPR_UNUSED(client);
if (context)
WTSCloseServer((HANDLE) context->vcm);
if (!context)
return;
WTSCloseServer((HANDLE) context->vcm);
if (context->dynvcReady)
{
CloseHandle(context->dynvcReady);
context->dynvcReady = NULL;
}
}
BOOL init_p_server_context(freerdp_peer* client)
@ -172,5 +180,11 @@ out_fail:
void proxy_data_free(proxyData* pdata)
{
connection_info_free(pdata->info);
if (pdata->connectionClosed)
{
CloseHandle(pdata->connectionClosed);
pdata->connectionClosed = NULL;
}
free(pdata);
}

View File

@ -366,12 +366,15 @@ fail:
disp_server_context_free(ps->disp);
}
if (ps->gfx)
rdpgfx_server_context_free(ps->gfx);
if (client->connected && !pf_common_connection_aborted_by_peer(pdata))
{
pf_server_handle_client_disconnection(client);
}
pc = (rdpContext*)pdata->pc;
pc = (rdpContext*) pdata->pc;
freerdp_client_stop(pc);
proxy_data_free(pdata);
freerdp_client_context_free(pc);