From ac68631f4c8ac07d7c55fc039ccd2b796f2d8969 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Sat, 4 Mar 2017 15:09:45 +0800 Subject: [PATCH] monitor-config-store: Don't crash when cleaning up after failing to load The logical monitor config array ownership was transferred to the config object when it was created, but was not unset when the config verification failed, causing the clean up path for invalid configs to try to clean up the same list again. https://bugzilla.gnome.org/show_bug.cgi?id=777732 --- src/backends/meta-monitor-config-store.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/backends/meta-monitor-config-store.c b/src/backends/meta-monitor-config-store.c index 9b02bc0c9..5d3f5f46d 100644 --- a/src/backends/meta-monitor-config-store.c +++ b/src/backends/meta-monitor-config-store.c @@ -546,6 +546,8 @@ handle_end_element (GMarkupParseContext *context, meta_monitors_config_new (parser->current_logical_monitor_configs, layout_mode); + parser->current_logical_monitor_configs = NULL; + if (!meta_verify_monitors_config (config, error)) { g_object_unref (config); @@ -555,8 +557,6 @@ handle_end_element (GMarkupParseContext *context, g_hash_table_replace (parser->config_store->configs, config->key, config); - parser->current_logical_monitor_configs = NULL; - parser->state = STATE_MONITORS; return; }