summaryrefslogtreecommitdiffstats
path: root/client/Wayland/wlf_cliprdr.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-05-04 01:25:12 +0000
commit827a4c3faa27e0c186452585b15094eee1119085 (patch)
treee6a08b0c767863d66f7d4a9de80db5edc7db29be /client/Wayland/wlf_cliprdr.c
parentReleasing progress-linux version 3.3.0+dfsg1-1~progress7.99u1. (diff)
downloadfreerdp3-827a4c3faa27e0c186452585b15094eee1119085.tar.xz
freerdp3-827a4c3faa27e0c186452585b15094eee1119085.zip
Merging upstream version 3.5.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'client/Wayland/wlf_cliprdr.c')
-rw-r--r--client/Wayland/wlf_cliprdr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/client/Wayland/wlf_cliprdr.c b/client/Wayland/wlf_cliprdr.c
index dc189d5..f0c3318 100644
--- a/client/Wayland/wlf_cliprdr.c
+++ b/client/Wayland/wlf_cliprdr.c
@@ -849,6 +849,7 @@ wlf_cliprdr_server_format_data_response(CliprdrClientContext* context,
ClipboardLock(clipboard->system);
EnterCriticalSection(&clipboard->lock);
+ BYTE* cdata = NULL;
UINT32 srcFormatId = 0;
UINT32 dstFormatId = 0;
switch (request->responseFormat)
@@ -895,14 +896,14 @@ wlf_cliprdr_server_format_data_response(CliprdrClientContext* context,
const BOOL sres = ClipboardSetData(clipboard->system, srcFormatId, data, size);
if (sres)
- data = ClipboardGetData(clipboard->system, dstFormatId, &len);
+ cdata = ClipboardGetData(clipboard->system, dstFormatId, &len);
- if (!sres || !data)
+ if (!sres || !cdata)
goto unlock;
if (request->responseFile)
{
- const size_t res = fwrite(data, 1, len, request->responseFile);
+ const size_t res = fwrite(cdata, 1, len, request->responseFile);
if (res == len)
rc = CHANNEL_RC_OK;
}
@@ -910,6 +911,7 @@ wlf_cliprdr_server_format_data_response(CliprdrClientContext* context,
rc = CHANNEL_RC_OK;
unlock:
+ free(cdata);
ClipboardUnlock(clipboard->system);
LeaveCriticalSection(&clipboard->lock);
fail: