From b10524fce26205c78b72a4f4e613204abf696378 Mon Sep 17 00:00:00 2001 From: Matthias Melcher Date: Tue, 9 Oct 2018 19:53:05 +0000 Subject: Avoiding crash when accessing free'd memory. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13064 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- fluid/fluid.cxx | 7 +++++-- fluid/function_panel.fl | 15 +++++++-------- 2 files changed, 12 insertions(+), 10 deletions(-) (limited to 'fluid') diff --git a/fluid/fluid.cxx b/fluid/fluid.cxx index e13a171b3..5b1cb0c35 100644 --- a/fluid/fluid.cxx +++ b/fluid/fluid.cxx @@ -566,7 +566,10 @@ void open_history_cb(Fl_Widget *, void *v) { set_modflag(0); undo_resume(); undo_clear(); - if (oldfilename) free((void *)oldfilename); + if (oldfilename) { + free((void *)oldfilename); + oldfilename = 0L; + } } void new_cb(Fl_Widget *, void *v) { @@ -1760,7 +1763,7 @@ int main(int argc,char **argv) { " -cs : write .cxx and .h and strings and exit\n" " -o : .cxx output filename, or extension if starts with '.'\n" " -h : .h output filename, or extension if starts with '.'\n"; - int len = (int)(strlen(msg) + strlen(argv[0]) + strlen(Fl::help)); + int len = (int)(strlen(msg) + strlen(argv[0]?argv[0]:"fluid") + strlen(Fl::help)); Fl_Plugin_Manager pm("commandline"); int i, n = pm.plugins(); for (i=0; ibuffer(new Fl_Text_Buffer());} code1 {data_comment_input->add_key_binding(FL_Tab, 0, use_tab_navigation);} @@ -536,8 +536,7 @@ Function {type_make_cb(Fl_Widget*,void*d)} {return_type void }} {} } -Function {make_widgetbin()} {open -} { +Function {make_widgetbin()} {} { Fl_Window widgetbin_panel { label {Widget Bin} callback {if (Fl::event()==FL_SHORTCUT && Fl::event_key()==FL_Escape) -- cgit v1.2.3