]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
boot-splash: don't crash in free if module not loaded
authorRay Strode <rstrode@redhat.com>
Mon, 10 Aug 2015 14:11:32 +0000 (10:11 -0400)
committerRay Strode <rstrode@redhat.com>
Mon, 10 Aug 2015 14:15:19 +0000 (10:15 -0400)
ply_boot_splash_free currently calls some code that depends
on a module being loaded.  We call ply_boot_splash_free to
clean up the boot splash object if a module can't be loaded,
leading to crash.

This commit addresses that issue by only calling the module
specific destruction code in ply_boot_splash_free in the case
where a module is loaded.

https://bugs.freedesktop.org/show_bug.cgi?id=91590

src/libply-splash-core/ply-boot-splash.c

index e853e1f5c92f84138052eff45299d53675f74c21..87a7a0c339a5549de2dc27d5cf5cace0634e47ee 100644 (file)
@@ -401,16 +401,17 @@ ply_boot_splash_free (ply_boot_splash_t *splash)
                                                        splash);
         }
 
-        ply_boot_splash_unset_keyboard (splash);
+        if (splash->module_handle != NULL) {
+                ply_boot_splash_unset_keyboard (splash);
 
-        remove_pixel_displays (splash);
-        ply_list_free (splash->pixel_displays);
+                remove_pixel_displays (splash);
+                ply_list_free (splash->pixel_displays);
 
-        remove_text_displays (splash);
-        ply_list_free (splash->text_displays);
+                remove_text_displays (splash);
+                ply_list_free (splash->text_displays);
 
-        if (splash->module_handle != NULL)
                 ply_boot_splash_unload (splash);
+        }
 
         if (splash->idle_trigger != NULL)
                 ply_trigger_free (splash->idle_trigger);