]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
plugins: free views that can't load
authorRay Strode <rstrode@redhat.com>
Thu, 24 Sep 2015 19:55:08 +0000 (15:55 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 23 May 2016 14:56:01 +0000 (10:56 -0400)
Trying to use an unloaded view can lead to crashes.
If a view can't be loaded, free it right away.

src/plugins/splash/fade-throbber/plugin.c

index 00410dea83f6ab85c3f9afb1963306dc2b05d9b0..aba2cc6213a54d4f499c3e7d97308f4130521d96 100644 (file)
@@ -295,8 +295,12 @@ load_views (ply_boot_splash_plugin_t *plugin)
                 view = ply_list_node_get_data (node);
                 next_node = ply_list_get_next_node (plugin->views, node);
 
-                if (view_load (view))
+                if (view_load (view)) {
                         view_loaded = true;
+                } else {
+                        ply_list_remove_node (plugin->views, node);
+                        view_free (view);
+                }
 
                 node = next_node;
         }