diff options
author | Ray Strode <halfline@gmail.com> | 2023-12-24 20:48:47 +0000 |
---|---|---|
committer | Ray Strode <halfline@gmail.com> | 2023-12-24 20:48:47 +0000 |
commit | 1a8e184885bbef7c085f74b799bcaef8985494be (patch) | |
tree | 7f3ede79196c542f23ea6fcf37e9b4dc27e168a1 | |
parent | 65aecea9b472855f1b7f68f0051ab266ac5c119c (diff) | |
parent | 07bc5992de6ddff2703ba13246ec03ce837adbdb (diff) |
Merge branch 'fix-label-crasher' into 'main'23.358.4
ply-label: Make NULL safe (again)
See merge request plymouth/plymouth!270
-rw-r--r-- | src/libply-splash-graphics/ply-label.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libply-splash-graphics/ply-label.c b/src/libply-splash-graphics/ply-label.c index 0c03ebc5..f49dd7f4 100644 --- a/src/libply-splash-graphics/ply-label.c +++ b/src/libply-splash-graphics/ply-label.c @@ -248,7 +248,10 @@ ply_label_set_text (ply_label_t *label, const char *text) { free (label->text); - label->text = strdup (text); + label->text = NULL; + + if (text != NULL) + label->text = strdup (text); if (label->rich_text) { ply_rich_text_drop_reference (label->rich_text); @@ -259,7 +262,7 @@ ply_label_set_text (ply_label_t *label, return; label->plugin_interface->set_text_for_control (label->control, - text?: ""); + label->text?: ""); } void |