From: Ray Strode Date: Mon, 10 Aug 2015 14:11:32 +0000 (-0400) Subject: boot-splash: don't crash in free if module not loaded X-Git-Tag: 0.9.3~52 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f80684387a0371d69df155d9d2bde058371c5aa2;p=thirdparty%2Fplymouth.git boot-splash: don't crash in free if module not loaded 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 --- diff --git a/src/libply-splash-core/ply-boot-splash.c b/src/libply-splash-core/ply-boot-splash.c index e853e1f5..87a7a0c3 100644 --- a/src/libply-splash-core/ply-boot-splash.c +++ b/src/libply-splash-core/ply-boot-splash.c @@ -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);