From: Ray Strode Date: Fri, 22 Dec 2023 13:27:30 +0000 (-0500) Subject: ply-label: Make NULL safe (again) X-Git-Tag: 23.358.4^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=07bc5992de6ddff2703ba13246ec03ce837adbdb;p=thirdparty%2Fplymouth.git ply-label: Make NULL safe (again) commit a045f01568f53ca10ef8b76d9f507ccd3546e9d8 tried to make ply-label NULL safe, but missed a strdup. This commit fixes that. --- 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