client: Check if channel has already been added
@@ -628,6 +628,13 @@ BOOL freerdp_client_add_static_channel(rdpSettings* settings, int count,
{
int index;
ADDIN_ARGV* args;
+
+ if (!settings || !params || !params[0])
+ return FALSE;
+
+ if (freerdp_static_channel_collection_find(settings, params[0]))
+ return TRUE;
+
args = (ADDIN_ARGV*) calloc(1, sizeof(ADDIN_ARGV));
if (!args)
@@ -673,6 +680,13 @@ BOOL freerdp_client_add_dynamic_channel(rdpSettings* settings, int count,
{
int index;
ADDIN_ARGV* args;
+
+ if (!settings || !params || !params[0])
+ return FALSE;
+
+ if (freerdp_dynamic_channel_collection_find(settings, params[0]))
+ return TRUE;
+
args = (ADDIN_ARGV*) malloc(sizeof(ADDIN_ARGV));
if (!args)
@@ -2737,8 +2751,6 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings)
}
if (settings->RedirectClipboard)
- {
- if (!freerdp_static_channel_collection_find(settings, "cliprdr"))
{
char* params[1];
params[0] = "cliprdr";
@@ -2746,7 +2758,6 @@ BOOL freerdp_client_load_addins(rdpChannels* channels, rdpSettings* settings)
if (!freerdp_client_add_static_channel(settings, 1, (char**) params))
return FALSE;
}
- }
if (settings->LyncRdpMode)
{
