Merge pull request #2811 from clivest/client_channel_interface_leak_fix

Fix race condition in freerdp_channels_client_load that could cause memory leak
This commit is contained in:
Bernhard Miklautz 2015-08-03 09:23:54 +02:00
commit 4fb0ad0cef

View File

@ -720,7 +720,6 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, P
EntryPoints.pVirtualChannelClose = FreeRDP_VirtualChannelClose; EntryPoints.pVirtualChannelClose = FreeRDP_VirtualChannelClose;
EntryPoints.pVirtualChannelWrite = FreeRDP_VirtualChannelWrite; EntryPoints.pVirtualChannelWrite = FreeRDP_VirtualChannelWrite;
g_pInterface = NULL;
EntryPoints.MagicNumber = FREERDP_CHANNEL_MAGIC_NUMBER; EntryPoints.MagicNumber = FREERDP_CHANNEL_MAGIC_NUMBER;
EntryPoints.ppInterface = &g_pInterface; EntryPoints.ppInterface = &g_pInterface;
EntryPoints.pExtendedData = data; EntryPoints.pExtendedData = data;
@ -731,6 +730,7 @@ int freerdp_channels_client_load(rdpChannels* channels, rdpSettings* settings, P
EnterCriticalSection(&g_channels_lock); EnterCriticalSection(&g_channels_lock);
g_pInterface = NULL;
g_ChannelInitData.channels = channels; g_ChannelInitData.channels = channels;
status = pChannelClientData->entry((PCHANNEL_ENTRY_POINTS) &EntryPoints); status = pChannelClientData->entry((PCHANNEL_ENTRY_POINTS) &EntryPoints);