aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/main.c')
-rw-r--r--calendar/gui/main.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/calendar/gui/main.c b/calendar/gui/main.c
index 3a49dfaa9a..6c4a4b4522 100644
--- a/calendar/gui/main.c
+++ b/calendar/gui/main.c
@@ -367,15 +367,14 @@ static void
save_ok (GtkWidget *widget, GtkFileSelection *fs)
{
GnomeCalendar *gcal;
+ gchar *fname;
gcal = GNOME_CALENDAR (gtk_object_get_user_data (GTK_OBJECT (fs)));
gtk_window_set_wmclass (GTK_WINDOW (gcal), "gnomecal", "gnomecal");
- if (gcal->cal->filename)
- g_free (gcal->cal->filename);
-
- gcal->cal->filename = g_strdup (gtk_file_selection_get_filename (fs));
- calendar_save (gcal->cal, gcal->cal->filename);
+ fname = g_strdup (gtk_file_selection_get_filename (fs));
+ calendar_save (gcal->cal, fname);
+ g_free(fname);
gtk_main_quit ();
}