From 5d2b0bc0cc28c384d528cdce8bf6b65f5e88b8b7 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 18 Sep 2017 12:34:14 +0200 Subject: [PATCH] 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 --- src/backends/meta-input-settings.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/backends/meta-input-settings.c b/src/backends/meta-input-settings.c index 83c06ad01..8130bf5fb 100644 --- a/src/backends/meta-input-settings.c +++ b/src/backends/meta-input-settings.c @@ -801,6 +801,7 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings, { MetaInputSettingsPrivate *priv; MetaMonitorManager *monitor_manager; + MetaLogicalMonitor *ret = NULL; guint n_values; GList *logical_monitors; GList *l; @@ -815,11 +816,11 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings, g_warning ("EDID configuration for device '%s' " "is incorrect, must have 3 values", clutter_input_device_get_device_name (device)); - return NULL; + goto out; } if (!*edid[0] && !*edid[1] && !*edid[2]) - return NULL; + goto out; monitor_manager = priv->monitor_manager; logical_monitors = @@ -833,10 +834,15 @@ meta_input_settings_find_logical_monitor (MetaInputSettings *input_settings, edid[0], edid[1], edid[2])) - return logical_monitor; + { + ret = logical_monitor; + break; + } } - return NULL; +out: + g_strfreev (edid); + return ret; } static void