summaryrefslogtreecommitdiff
path: root/src/ntl-index-panel.c
diff options
context:
space:
mode:
authorJohn Sullivan <sullivan@src.gnome.org>2000-01-10 16:36:00 +0000
committerJohn Sullivan <sullivan@src.gnome.org>2000-01-10 16:36:00 +0000
commitc5864f0483a2e56adc33e8e9c80c47671fec47e0 (patch)
tree43a176dfaade1fd18dfffd2d4cefa64136d56935 /src/ntl-index-panel.c
parentbdd9fc25b24309c8f9183113b0c14492b8277af5 (diff)
downloadnautilus-c5864f0483a2e56adc33e8e9c80c47671fec47e0.tar.gz
Check for NULL filename
Diffstat (limited to 'src/ntl-index-panel.c')
-rw-r--r--src/ntl-index-panel.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/ntl-index-panel.c b/src/ntl-index-panel.c
index 3b3d92892..bd8e61d3f 100644
--- a/src/ntl-index-panel.c
+++ b/src/ntl-index-panel.c
@@ -298,13 +298,22 @@ void nautilus_index_panel_set_up_label(GtkWidget* widget, const gchar *uri)
temp_uri[slash_pos] = '\0';
vfs_uri = gnome_vfs_uri_new(temp_uri);
+ g_free(temp_uri);
+
file_name = gnome_vfs_uri_get_basename(vfs_uri);
gnome_vfs_uri_destroy(vfs_uri);
+
+ if (file_name == NULL)
+ {
+ return;
+ }
label_widget = gtk_label_new(file_name);
gtk_box_pack_start(GTK_BOX(index_panel->per_uri_container), label_widget, 0, 0, 0);
label_font = select_font(file_name, widget->allocation.width - 4, "-bitstream-courier-medium-r-normal-*-%d-*-*-*-*-*-*-*");
+ g_free((gchar*) file_name);
+
if (label_font != NULL)
{
GtkStyle *temp_style;
@@ -315,8 +324,6 @@ void nautilus_index_panel_set_up_label(GtkWidget* widget, const gchar *uri)
}
gtk_widget_show(label_widget);
- g_free((gchar*) file_name);
- g_free(temp_uri);
}
/* this routine populates the index panel with the per-uri information */