From 7591cd8e51e7506aaa653569d2ae438a58b8f012 Mon Sep 17 00:00:00 2001 From: Armin Novak Date: Wed, 25 Feb 2026 19:52:10 +0100 Subject: [PATCH] [core,utils] ignore NULL values in remove_rdpdr_type if there are no redirected devices of given type ignore the NULL value and return success. --- libfreerdp/core/utils.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/libfreerdp/core/utils.c b/libfreerdp/core/utils.c index 130e55575..ed8681134 100644 --- a/libfreerdp/core/utils.c +++ b/libfreerdp/core/utils.c @@ -333,8 +333,11 @@ static BOOL remove_rdpdr_type(rdpSettings* settings, UINT32 type) do { printer = freerdp_device_collection_find_type(settings, type); - if (!freerdp_device_collection_del(settings, printer)) - rc = FALSE; + if (printer) + { + if (!freerdp_device_collection_del(settings, printer)) + rc = FALSE; + } freerdp_device_free(printer); } while (printer); return rc;