X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=unix%2Fgtkdlg.c;h=eb93d3358baf16ff61f33b562be212f0740823e5;hb=615455a913d5d28c1368406474ae4bb06697bf44;hp=2781db73be3d85c600a5a0dac2c8428d68180ad0;hpb=62cbc7dc0b33808dc8794c59f60971fbba97894b;p=PuTTY.git diff --git a/unix/gtkdlg.c b/unix/gtkdlg.c index 2781db73..eb93d335 100644 --- a/unix/gtkdlg.c +++ b/unix/gtkdlg.c @@ -910,9 +910,13 @@ void dlg_filesel_set(union control *ctrl, void *dlg, Filename *fn) { struct dlgparam *dp = (struct dlgparam *)dlg; struct uctrl *uc = dlg_find_byctrl(dp, ctrl); + /* We must copy fn->path before passing it to gtk_entry_set_text. + * See comment in dlg_editbox_set() for the reasons. */ + char *duppath = dupstr(fn->path); assert(uc->ctrl->generic.type == CTRL_FILESELECT); assert(uc->entry != NULL); - gtk_entry_set_text(GTK_ENTRY(uc->entry), fn->path); + gtk_entry_set_text(GTK_ENTRY(uc->entry), duppath); + sfree(duppath); } Filename *dlg_filesel_get(union control *ctrl, void *dlg) @@ -928,9 +932,13 @@ void dlg_fontsel_set(union control *ctrl, void *dlg, FontSpec *fs) { struct dlgparam *dp = (struct dlgparam *)dlg; struct uctrl *uc = dlg_find_byctrl(dp, ctrl); + /* We must copy fs->name before passing it to gtk_entry_set_text. + * See comment in dlg_editbox_set() for the reasons. */ + char *dupname = dupstr(fs->name); assert(uc->ctrl->generic.type == CTRL_FONTSELECT); assert(uc->entry != NULL); - gtk_entry_set_text(GTK_ENTRY(uc->entry), fs->name); + gtk_entry_set_text(GTK_ENTRY(uc->entry), dupname); + sfree(dupname); } FontSpec *dlg_fontsel_get(union control *ctrl, void *dlg) @@ -3406,7 +3414,7 @@ static void licence_clicked(GtkButton *button, gpointer data) char *title; char *licence = - "Copyright 1997-2011 Simon Tatham.\n\n" + "Copyright 1997-2012 Simon Tatham.\n\n" "Portions copyright Robert de Bath, Joris van Rantwijk, Delian " "Delchev, Andreas Schultz, Jeroen Massar, Wez Furlong, Nicolas " @@ -3487,7 +3495,7 @@ void about_box(void *window) w, FALSE, FALSE, 5); gtk_widget_show(w); - w = gtk_label_new("Copyright 1997-2011 Simon Tatham. All rights reserved"); + w = gtk_label_new("Copyright 1997-2012 Simon Tatham. All rights reserved"); gtk_box_pack_start(GTK_BOX(GTK_DIALOG(aboutbox)->vbox), w, FALSE, FALSE, 5); gtk_widget_show(w);