From 3f163cee9cb19d21232e7dd86eaa19797d6bb1cf Mon Sep 17 00:00:00 2001 From: akallabeth Date: Mon, 26 Jan 2026 12:31:30 +0100 Subject: [PATCH] [warnings] fix unused result warnings --- channels/smartcard/client/smartcard_main.c | 3 ++- libfreerdp/core/freerdp.c | 6 ++++-- libfreerdp/core/surface.c | 3 ++- server/Sample/sfreerdp.c | 3 ++- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/channels/smartcard/client/smartcard_main.c b/channels/smartcard/client/smartcard_main.c index fb9f4928d..3acad1286 100644 --- a/channels/smartcard/client/smartcard_main.c +++ b/channels/smartcard/client/smartcard_main.c @@ -713,7 +713,8 @@ FREERDP_ENTRY_POINT(UINT VCAPITYPE DeviceServiceEntry(PDEVICE_SERVICE_ENTRY_POIN if (pEntryPoints->device->Name) { - smartcard_call_context_add(smartcard->callctx, pEntryPoints->device->Name); + if (!smartcard_call_context_add(smartcard->callctx, pEntryPoints->device->Name)) + goto fail; } sSmartcard = smartcard; diff --git a/libfreerdp/core/freerdp.c b/libfreerdp/core/freerdp.c index 02d8d33aa..c1a90f991 100644 --- a/libfreerdp/core/freerdp.c +++ b/libfreerdp/core/freerdp.c @@ -257,14 +257,16 @@ BOOL freerdp_connect(freerdp* instance) while (pcap_has_next_record(update->pcap_rfx) && status) { - pcap_get_next_record_header(update->pcap_rfx, &record); + if (!pcap_get_next_record_header(update->pcap_rfx, &record)) + break; s = transport_take_from_pool(rdp->transport, record.length); if (!s) break; record.data = Stream_Buffer(s); - pcap_get_next_record_content(update->pcap_rfx, &record); + if (!pcap_get_next_record_content(update->pcap_rfx, &record)) + break; Stream_SetLength(s, record.length); Stream_SetPosition(s, 0); diff --git a/libfreerdp/core/surface.c b/libfreerdp/core/surface.c index 6447815a5..f8354f983 100644 --- a/libfreerdp/core/surface.c +++ b/libfreerdp/core/surface.c @@ -234,7 +234,8 @@ int update_recv_surfcmds(rdpUpdate* update, wStream* s) { const size_t size = Stream_GetPosition(s) - start; /* TODO: treat return values */ - pcap_add_record(up->pcap_rfx, mark, size); + if (!pcap_add_record(up->pcap_rfx, mark, size)) + return -1; pcap_flush(up->pcap_rfx); } } diff --git a/server/Sample/sfreerdp.c b/server/Sample/sfreerdp.c index 07193f9d7..598588bf6 100644 --- a/server/Sample/sfreerdp.c +++ b/server/Sample/sfreerdp.c @@ -565,7 +565,8 @@ static BOOL tf_peer_dump_rfx(freerdp_peer* client) break; record.data = Stream_Buffer(s); - pcap_get_next_record_content(pcap_rfx, &record); + if (!pcap_get_next_record_content(pcap_rfx, &record)) + break; Stream_SetPosition(s, Stream_Capacity(s)); if (info->test_dump_rfx_realtime &&