meta-input-settings: Fix strv memleak in find_logical_monitor()

The return value from g_settings_get_strv must be g_strfreev-ed.

https://bugzilla.gnome.org/show_bug.cgi?id=787836
This commit is contained in:
Hans de Goede 2017-09-18 12:34:14 +02:00 committed by Carlos Garnacho
parent 7e3a780dcd
commit 5d2b0bc0cc

View File

@ -801,6 +801,7 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings,
{ {
MetaInputSettingsPrivate *priv; MetaInputSettingsPrivate *priv;
MetaMonitorManager *monitor_manager; MetaMonitorManager *monitor_manager;
MetaLogicalMonitor *ret = NULL;
guint n_values; guint n_values;
GList *logical_monitors; GList *logical_monitors;
GList *l; GList *l;
@ -815,11 +816,11 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings,
g_warning ("EDID configuration for device '%s' " g_warning ("EDID configuration for device '%s' "
"is incorrect, must have 3 values", "is incorrect, must have 3 values",
clutter_input_device_get_device_name (device)); clutter_input_device_get_device_name (device));
return NULL; goto out;
} }
if (!*edid[0] && !*edid[1] && !*edid[2]) if (!*edid[0] && !*edid[1] && !*edid[2])
return NULL; goto out;
monitor_manager = priv->monitor_manager; monitor_manager = priv->monitor_manager;
logical_monitors = logical_monitors =
@ -833,10 +834,15 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings,
edid[0], edid[0],
edid[1], edid[1],
edid[2])) edid[2]))
return logical_monitor; {
ret = logical_monitor;
break;
}
} }
return NULL; out:
g_strfreev (edid);
return ret;
} }
static void static void