[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.
This commit is contained in:
Armin Novak
2026-02-25 19:52:10 +01:00
parent de32f5b80a
commit 7591cd8e51

View File

@@ -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;