From 1da844ec47972d1f88a039d0234d77084ba558cb Mon Sep 17 00:00:00 2001 From: Michael Terry Date: Mon, 14 Mar 2011 16:01:04 -0400 Subject: be a little more cautious about pointers in sanitize_label_text --- libdbusmenu-gtk/parser.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'libdbusmenu-gtk') 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 * -- cgit v1.2.3