aboutsummaryrefslogtreecommitdiff
path: root/libdbusmenu-gtk
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2011-03-14 16:01:04 -0400
committerMichael Terry <mike@mterry.name>2011-03-14 16:01:04 -0400
commit1da844ec47972d1f88a039d0234d77084ba558cb (patch)
treef66d6fa402aa66992f85ba613b47cf26fdaa6fbd /libdbusmenu-gtk
parent5df1c8111987669e7f450141b50f056dc30cb4f9 (diff)
downloadlibdbusmenu-1da844ec47972d1f88a039d0234d77084ba558cb.tar.gz
libdbusmenu-1da844ec47972d1f88a039d0234d77084ba558cb.tar.bz2
libdbusmenu-1da844ec47972d1f88a039d0234d77084ba558cb.zip
be a little more cautious about pointers in sanitize_label_text
Diffstat (limited to 'libdbusmenu-gtk')
-rw-r--r--libdbusmenu-gtk/parser.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/libdbusmenu-gtk/parser.c b/libdbusmenu-gtk/parser.c
index 1b032bb..2a057b4 100644
--- a/libdbusmenu-gtk/parser.c
+++ b/libdbusmenu-gtk/parser.c
@@ -371,14 +371,20 @@ sanitize_label_text (const gchar * label)
which we don't. */
gchar * sanitized = NULL;
GError * error = NULL;
+
+ if (label == NULL) {
+ return NULL;
+ }
+
if (pango_parse_markup (label, -1, 0, NULL, &sanitized, NULL, &error)) {
return sanitized;
}
- else {
+
+ if (error != NULL) {
g_warning ("Could not parse '%s': %s", label, error->message);
g_error_free (error);
- return g_strdup (label);
}
+ return g_strdup (label);
}
static gchar *