From 5e1b92cb65852ec9480e0b31699f395c1832daef Mon Sep 17 00:00:00 2001 From: Michael Jumper Date: Mon, 2 Mar 2020 15:01:58 -0800 Subject: [PATCH] GUACAMOLE-979: Ensure all FreeRDP settings strings are independent duplicates of their corresponding Guacamole settings. FreeRDP 2.0.0 will automatically free all settings strings when the settings structure is freed. As we will also do the same for our own settings strings, the FreeRDP settings must be kept independent. There is no guarantee that the FreeRDP settings will be pushed before an error causes the connection to abort, nor that the FreeRDP settings will not need to be pushed multiple times due to an automatic reconnect. --- src/protocols/rdp/settings.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/protocols/rdp/settings.c b/src/protocols/rdp/settings.c index 864e6427..117b50bf 100644 --- a/src/protocols/rdp/settings.c +++ b/src/protocols/rdp/settings.c @@ -1296,9 +1296,9 @@ void guac_rdp_push_settings(guac_client* client, rdp_settings->Workarea = TRUE; rdp_settings->RemoteApplicationMode = TRUE; rdp_settings->RemoteAppLanguageBarSupported = TRUE; - rdp_settings->RemoteApplicationProgram = guac_settings->remote_app; + rdp_settings->RemoteApplicationProgram = guac_rdp_strdup(guac_settings->remote_app); rdp_settings->ShellWorkingDirectory = guac_rdp_strdup(guac_settings->remote_app_dir); - rdp_settings->RemoteApplicationCmdLine = guac_settings->remote_app_args; + rdp_settings->RemoteApplicationCmdLine = guac_rdp_strdup(guac_settings->remote_app_args); } /* Preconnection ID */ @@ -1312,7 +1312,7 @@ void guac_rdp_push_settings(guac_client* client, if (guac_settings->preconnection_blob != NULL) { rdp_settings->NegotiateSecurityLayer = FALSE; rdp_settings->SendPreconnectionPdu = TRUE; - rdp_settings->PreconnectionBlob = guac_settings->preconnection_blob; + rdp_settings->PreconnectionBlob = guac_rdp_strdup(guac_settings->preconnection_blob); } /* Enable use of RD gateway if a gateway hostname is provided */