diff --git a/channels/cliprdr/client/cliprdr_main.c b/channels/cliprdr/client/cliprdr_main.c index 5be571942..7dcd6bf0d 100644 --- a/channels/cliprdr/client/cliprdr_main.c +++ b/channels/cliprdr/client/cliprdr_main.c @@ -1182,6 +1182,7 @@ static UINT cliprdr_virtual_channel_event_disconnected(cliprdrPlugin* cliprdr) static UINT cliprdr_virtual_channel_event_terminated(cliprdrPlugin* cliprdr) { cliprdr->InitHandle = 0; + free(cliprdr->context); free(cliprdr); return CHANNEL_RC_OK; } diff --git a/channels/drdynvc/client/drdynvc_main.c b/channels/drdynvc/client/drdynvc_main.c index acf873c07..4c49dbbe5 100644 --- a/channels/drdynvc/client/drdynvc_main.c +++ b/channels/drdynvc/client/drdynvc_main.c @@ -1436,6 +1436,7 @@ static UINT drdynvc_virtual_channel_event_terminated(drdynvcPlugin* drdynvc) return CHANNEL_RC_BAD_CHANNEL_HANDLE; drdynvc->InitHandle = 0; + free(drdynvc->context); free(drdynvc); return CHANNEL_RC_OK; } diff --git a/channels/encomsp/client/encomsp_main.c b/channels/encomsp/client/encomsp_main.c index bd5bd2c2e..4eb074ff2 100644 --- a/channels/encomsp/client/encomsp_main.c +++ b/channels/encomsp/client/encomsp_main.c @@ -1148,6 +1148,7 @@ static UINT encomsp_virtual_channel_event_disconnected(encomspPlugin* encomsp) static UINT encomsp_virtual_channel_event_terminated(encomspPlugin* encomsp) { encomsp->InitHandle = 0; + free(encomsp->context); free(encomsp); return CHANNEL_RC_OK; } diff --git a/channels/rail/client/rail_main.c b/channels/rail/client/rail_main.c index 6ecaf7a30..ad93430c4 100644 --- a/channels/rail/client/rail_main.c +++ b/channels/rail/client/rail_main.c @@ -738,6 +738,7 @@ static UINT rail_virtual_channel_event_disconnected(railPlugin* rail) static void rail_virtual_channel_event_terminated(railPlugin* rail) { rail->InitHandle = 0; + free(rail->context); free(rail); } diff --git a/channels/remdesk/client/remdesk_main.c b/channels/remdesk/client/remdesk_main.c index ec3948cfe..5a65770b7 100644 --- a/channels/remdesk/client/remdesk_main.c +++ b/channels/remdesk/client/remdesk_main.c @@ -942,6 +942,7 @@ static UINT remdesk_virtual_channel_event_disconnected(remdeskPlugin* remdesk) static void remdesk_virtual_channel_event_terminated(remdeskPlugin* remdesk) { remdesk->InitHandle = 0; + free(remdesk->context); free(remdesk); } diff --git a/libfreerdp/core/client.c b/libfreerdp/core/client.c index 0683855bb..24e1ac8f0 100644 --- a/libfreerdp/core/client.c +++ b/libfreerdp/core/client.c @@ -663,12 +663,6 @@ void freerdp_channels_close(rdpChannels* channels, freerdp* instance) { pChannelOpenData = &channels->openDataList[index]; - if (pChannelOpenData->pInterface) - { - free(pChannelOpenData->pInterface); - pChannelOpenData->pInterface = NULL; - } - freerdp_channel_remove_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle); if (channels->openHandles)