GUACAMOLE-927: Abort RDP connection if FreeRDP fails to initialize.
diff --git a/src/protocols/rdp/rdp.c b/src/protocols/rdp/rdp.c
index 5cf651a..7e6b3e8 100644
--- a/src/protocols/rdp/rdp.c
+++ b/src/protocols/rdp/rdp.c
@@ -367,7 +367,14 @@
/* Allocate FreeRDP context */
rdp_inst->ContextSize = sizeof(rdp_freerdp_context);
- freerdp_context_new(rdp_inst);
+ if (!freerdp_context_new(rdp_inst)) {
+ guac_client_abort(client, GUAC_PROTOCOL_STATUS_SERVER_ERROR,
+ "FreeRDP initialization failed before connecting. Please "
+ "check for errors earlier in the logs and/or enable "
+ "debug-level logging for guacd.");
+ return 1;
+ }
+
((rdp_freerdp_context*) rdp_inst->context)->client = client;
/* Load keymap into client */