Right now if the label plugin fails during initialization, the plymouth
daemon crashes.
This commit adds a NULL check to fail more gracefully.
Reviewed-by: Petr Vorel <pvorel@suse.cz>
Signed-off-by: Fabian Vogt <fvogt@suse.com>
label->control = label->plugin_interface->create_control ();
+ if (label->control == NULL) {
+ ply_save_errno ();
+ label->plugin_interface = NULL;
+ ply_close_module (label->module_handle);
+ label->module_handle = NULL;
+ ply_restore_errno ();
+ return false;
+ }
+
if (label->text != NULL)
label->plugin_interface->set_text_for_control (label->control,
label->text);