From c0452772a0020177c60f98ad45fee88df9281ad7 Mon Sep 17 00:00:00 2001 From: Harry van Haaren Date: Sun, 9 Apr 2017 15:39:39 +0100 Subject: [PATCH] fixed possible mem leak in goptions dialog --- src/goptions.cxx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/goptions.cxx b/src/goptions.cxx index cffbc2c..f76c422 100644 --- a/src/goptions.cxx +++ b/src/goptions.cxx @@ -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();