From 57c7d75c43c862ceaa7fa2050e37a64838817402 Mon Sep 17 00:00:00 2001 From: Sebastian Keller Date: Thu, 1 Sep 2022 19:52:21 +0200 Subject: [PATCH] color-device: Don't wrongly use Unknown vendor in ICC profile from EDID If the vendor_name was previously successfully determined, we would end up in the else case, overwriting it with "Unknown vendor" and leaking the previous vendor_name. Part-of: --- src/backends/meta-color-device.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/backends/meta-color-device.c b/src/backends/meta-color-device.c index f8240606a..272fade57 100644 --- a/src/backends/meta-color-device.c +++ b/src/backends/meta-color-device.c @@ -877,10 +877,13 @@ create_icc_profile_from_edid (MetaColorDevice *color_device, cd_icc_set_description (cd_icc, NULL, meta_monitor_get_display_name (monitor)); - if (!vendor_name && vendor) - vendor_name = g_strdup (vendor); - else - vendor_name = g_strdup ("Unknown vendor"); + if (!vendor_name) + { + if (vendor) + vendor_name = g_strdup (vendor); + else + vendor_name = g_strdup ("Unknown vendor"); + } cd_icc_set_manufacturer (cd_icc, NULL, vendor_name); /* Set the framework creator metadata */