static WINPR_TLS void* g_pInterface = NULL;
static WINPR_TLS rdpChannels* g_channels = NULL; /* use only for VirtualChannelInit hack */
-static volatile LONG g_OpenHandleSeq = 1; /* use global counter to ensure uniqueness across channel manager instances */
+static volatile LONG g_OpenHandleSeq =
+ 1; /* use global counter to ensure uniqueness across channel manager instances */
static WINPR_TLS rdpChannelHandles g_ChannelHandles = { NULL, NULL };
static CHANNEL_OPEN_DATA* freerdp_channels_find_channel_open_data_by_name(
/* tell all libraries we are shutting down */
for (index = 0; index < channels->clientDataCount; index++)
{
+ char* name[9];
ChannelDisconnectedEventArgs e;
pChannelClientData = &channels->clientDataList[index];
}
if (getChannelError(instance->context) != CHANNEL_RC_OK)
- goto fail;
+ continue;
pChannelOpenData = &channels->openDataList[index];
- name = (char*) malloc(9);
-
- if (!name)
- return -1;
-
CopyMemory(name, pChannelOpenData->name, 8);
name[8] = '\0';
EventArgsInit(&e, "freerdp");
e.name = name;
e.pInterface = pChannelOpenData->pInterface;
PubSub_OnChannelDisconnected(instance->context->pubSub, instance->context, &e);
- free(name);
}
-fail:
return error;
}
pChannelOpenData = &channels->openDataList[channels->openDataCount];
pChannelOpenData->OpenHandle = InterlockedIncrement(&g_OpenHandleSeq);
pChannelOpenData->channels = channels;
- freerdp_channel_add_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle, (void*) channels);
+ freerdp_channel_add_open_handle_data(&g_ChannelHandles, pChannelOpenData->OpenHandle,
+ (void*) channels);
HashTable_Add(channels->openHandles, (void*)(UINT_PTR) pChannelOpenData->OpenHandle,
(void*) pChannelOpenData);
pChannelOpenData->flags = 1; /* init */