diff options
author | Steven Rostedt <srostedt@redhat.com> | 2009-12-31 00:12:10 -0500 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2009-12-31 00:12:10 -0500 |
commit | ba835f600128ba390b1900914fdb809acbd79c5c (patch) | |
tree | f9215637e1fb45a5245ae7af33115d62c6bd7e74 | |
parent | 82ad35799a8751c7020c10d40dfaf2f0b6a6a881 (diff) |
trace-view: Handle case that cell has no text
If for some reason a cell in a column contains no text, then
exit the data_func, otherwise we may segfault.
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r-- | trace-view.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/trace-view.c b/trace-view.c index e99a8af..6dd72ee 100644 --- a/trace-view.c +++ b/trace-view.c | |||
@@ -123,6 +123,9 @@ void trace_view_data_func(GtkTreeViewColumn *column, GtkCellRenderer *renderer, | |||
123 | "font-desc", &pfd, /* apparently don't have to free this */ | 123 | "font-desc", &pfd, /* apparently don't have to free this */ |
124 | NULL); | 124 | NULL); |
125 | 125 | ||
126 | if (!text) | ||
127 | goto out; | ||
128 | |||
126 | /* Make sure there is enough room to render the column label. */ | 129 | /* Make sure there is enough room to render the column label. */ |
127 | str = text; | 130 | str = text; |
128 | str_len = strlen(str); | 131 | str_len = strlen(str); |
@@ -148,8 +151,9 @@ void trace_view_data_func(GtkTreeViewColumn *column, GtkCellRenderer *renderer, | |||
148 | gtk_tree_view_column_set_fixed_width(column, new_w); | 151 | gtk_tree_view_column_set_fixed_width(column, new_w); |
149 | } | 152 | } |
150 | 153 | ||
151 | g_value_unset(&val); | ||
152 | g_free(text); | 154 | g_free(text); |
155 | out: | ||
156 | g_value_unset(&val); | ||
153 | } | 157 | } |
154 | 158 | ||
155 | void | 159 | void |