Skip to content

Fix folder share; BUG: 482137

Fabio Bas requested to merge ctrlaltca/krdc:media_share_fix into master

As per comment https://bugs.kde.org/show_bug.cgi?id=482137#c6

This is a bug in RdpSession::start().

Actually the code is wrong in a few ways:

  1. freerdp_client_add_device_channel() expects the number of strings passed, which should be >= 2 for the "drive" channel. Passing 1 will cause the function to abort (see https://github.com/FreeRDP/FreeRDP/blob/5b14b7cbdd36414f1838047f21502654bd32ebb1/client/common/cmdline.c#L539)
  2. strdup is used to copy the string "drive", but the pointer returned is never freed, causing a memory leak (see https://en.cppreference.com/w/c/experimental/dynamic/strdup)

Merge request reports