Github user necouchman commented on a diff in the pull request:

    https://github.com/apache/guacamole-server/pull/207#discussion_r238669729
  
    --- Diff: src/protocols/rdp/guac_rdpdr/rdpdr_fs_service.c ---
    @@ -153,5 +153,42 @@ void guac_rdpdr_register_fs(guac_rdpdrPlugin* rdpdr, 
char* drive_name) {
         /* Init data */
         device->data = rdp_client->filesystem;
     
    +   /* Init directory for file transfer */
    +   int create_fs = 0;
    +
    +   if (rdp_client) {
    +           guac_rdp_settings* settings = rdp_client->settings;
    +           if (settings) {
    +                   create_fs = settings->create_drive_path;
    +           }
    +           else {
    +                   guac_client_log(device->rdpdr->client, GUAC_LOG_ERROR, 
"No settings.");
    +           }
    +   }
    +   else {
    +           guac_client_log(device->rdpdr->client, GUAC_LOG_ERROR, "No rdp 
client.");
    +   }
    +
    +   if (create_fs) {
    --- End diff --
    
    My guess is that this and a bunch of the code above could be simplified 
into something like this:
    
        if (rdp_client->settings->create_drive_path)
    
    Since both `rdp_client` and `rdp_client->settings` should be initialized 
and defined by this point in the code.


---

Reply via email to