rdpsnd: fix some null pointer crashes.

This commit is contained in:
Vic Lee 2013-01-22 23:26:55 +08:00
parent 104ff8169d
commit ec54a44449
2 changed files with 18 additions and 9 deletions

View File

@ -650,12 +650,15 @@ static void rdpsnd_process_terminate(rdpSvcPlugin* plugin)
if (rdpsnd->device)
IFCALL(rdpsnd->device->Free, rdpsnd->device);
while ((item = list_dequeue(rdpsnd->data_out_list)) != NULL)
if (rdpsnd->data_out_list)
{
stream_free(item->data_out);
free(item);
while ((item = list_dequeue(rdpsnd->data_out_list)) != NULL)
{
stream_free(item->data_out);
free(item);
}
list_free(rdpsnd->data_out_list);
}
list_free(rdpsnd->data_out_list);
if (rdpsnd->subsystem)
free(rdpsnd->subsystem);

View File

@ -338,16 +338,22 @@ static void svc_plugin_process_terminated(rdpSvcPlugin* plugin)
{
svc_data_in_item* item;
freerdp_thread_stop(plugin->priv->thread);
freerdp_thread_free(plugin->priv->thread);
if (plugin->priv->thread)
{
freerdp_thread_stop(plugin->priv->thread);
freerdp_thread_free(plugin->priv->thread);
}
plugin->channel_entry_points.pVirtualChannelClose(plugin->priv->open_handle);
svc_plugin_remove(plugin);
while ((item = list_dequeue(plugin->priv->data_in_list)) != NULL)
svc_data_in_item_free(item);
list_free(plugin->priv->data_in_list);
if (plugin->priv->data_in_list)
{
while ((item = list_dequeue(plugin->priv->data_in_list)) != NULL)
svc_data_in_item_free(item);
list_free(plugin->priv->data_in_list);
}
if (plugin->priv->data_in != NULL)
{