Do not write usbdevicestoredirect if the string is NULL
@@ -898,6 +898,7 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
UINT32 LoadBalanceInfoLength;
const char* GatewayHostname = NULL;
char* redirectCameras = NULL;
+ char* redirectUsb = NULL;
if (!FILE_POPULATE_STRING(&file->Domain, settings, FreeRDP_Domain) ||
!FILE_POPULATE_STRING(&file->Username, settings, FreeRDP_Username) ||
@@ -1058,8 +1059,10 @@ BOOL freerdp_client_populate_rdp_file_from_settings(rdpFile* file, const rdpSett
file->RedirectCameras = redirectCameras;
}
#ifdef CHANNEL_URBDRC_CLIENT
- file->UsbDevicesToRedirect =
- freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
+ redirectUsb = freerdp_client_channel_args_to_string(settings, URBDRC_CHANNEL_NAME, "device:");
+ if (redirectUsb)
+ file->UsbDevicesToRedirect = redirectUsb;
+
#endif
file->RedirectClipboard = freerdp_settings_get_bool(settings, FreeRDP_RedirectClipboard);
file->RedirectPrinters = freerdp_settings_get_bool(settings, FreeRDP_RedirectPrinters);
