mirror of
https://github.com/morgan9e/FreeRDP
synced 2026-04-15 00:44:19 +09:00
[channels,drdynvc] reset channel_callback before close
The channel_callback usually frees up the memory of the callback. To ensure that there is no access to any of the data structures in it invalidate the pointer used to access it before a free.
This commit is contained in:
@@ -510,6 +510,7 @@ static UINT dvcman_channel_close(DVCMAN_CHANNEL* channel, BOOL perRequest, BOOL
|
||||
|
||||
{
|
||||
IWTSVirtualChannelCallback* cb = channel->channel_callback;
|
||||
channel->channel_callback = NULL;
|
||||
if (cb)
|
||||
{
|
||||
check_open_close_receive(channel);
|
||||
@@ -517,8 +518,6 @@ static UINT dvcman_channel_close(DVCMAN_CHANNEL* channel, BOOL perRequest, BOOL
|
||||
}
|
||||
}
|
||||
|
||||
channel->channel_callback = NULL;
|
||||
|
||||
if (channel->dvcman && channel->dvcman->drdynvc)
|
||||
{
|
||||
if (context)
|
||||
@@ -796,14 +795,13 @@ out:
|
||||
*/
|
||||
static UINT dvcman_open_channel(drdynvcPlugin* drdynvc, DVCMAN_CHANNEL* channel)
|
||||
{
|
||||
IWTSVirtualChannelCallback* pCallback = NULL;
|
||||
UINT error = CHANNEL_RC_OK;
|
||||
|
||||
WINPR_ASSERT(drdynvc);
|
||||
WINPR_ASSERT(channel);
|
||||
if (channel->state == DVC_CHANNEL_RUNNING)
|
||||
{
|
||||
pCallback = channel->channel_callback;
|
||||
IWTSVirtualChannelCallback* pCallback = channel->channel_callback;
|
||||
|
||||
if (pCallback->OnOpen)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user