comparison gtk/dw.c @ 214:0e98514a3905

Applied patch from Mark Hessling to prevent the return buffer from the file dialup from being free()ed before being strdup()ed.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Tue, 04 Feb 2003 11:03:48 +0000
parents 5349a0735fda
children 03e68274623d
comparison
equal deleted inserted replaced
213:f8b50901ac45 214:0e98514a3905
6833 #if GTK_MAJOR_VERSION > 1 6833 #if GTK_MAJOR_VERSION > 1
6834 const char *tmp; 6834 const char *tmp;
6835 #else 6835 #else
6836 char *tmp; 6836 char *tmp;
6837 #endif 6837 #endif
6838 char *tmpdup=NULL;
6838 6839
6839 if(!dwwait) 6840 if(!dwwait)
6840 return FALSE; 6841 return FALSE;
6841 6842
6842 tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dwwait->data)); 6843 if((tmp = gtk_file_selection_get_filename(GTK_FILE_SELECTION(dwwait->data))))
6844 tmpdup = strdup(tmp);
6843 gtk_widget_destroy(GTK_WIDGET(dwwait->data)); 6845 gtk_widget_destroy(GTK_WIDGET(dwwait->data));
6844 _dw_file_active = 0; 6846 _dw_file_active = 0;
6845 dw_dialog_dismiss(dwwait, (void *)(tmp ? strdup(tmp) : NULL)); 6847 dw_dialog_dismiss(dwwait, (void *)tmpdup);
6846 return FALSE; 6848 return FALSE;
6847 } 6849 }
6848 6850
6849 /* Internal function to handle the file Cancel press */ 6851 /* Internal function to handle the file Cancel press */
6850 gint _gtk_file_cancel(GtkWidget *widget, DWDialog *dwwait) 6852 gint _gtk_file_cancel(GtkWidget *widget, DWDialog *dwwait)