fixed possible mem leak in goptions dialog

main
Harry van Haaren 2017-04-09 15:39:39 +01:00
parent 7f57f1d450
commit c0452772a0
1 changed files with 4 additions and 1 deletions

View File

@ -359,7 +359,10 @@ void ControllerUI::addBinding( Binding* b )
// button to remove a binding, uses bindingsID vector to get unique number
stringstream id;
id << b->ID;
Fl_Button* but = new Fl_Button(35, 35, 25, 25, strdup(id.str().c_str() ) );
char *str = strdup(id.str().c_str());
Fl_Button* but = new Fl_Button(35, 35, 25, 25, str );
if(!but)
free(str);
but->callback( deleteBindingFromController, this );
but->redraw();