all repos — openbox @ 0a3cfdfcb956024639a05549a50586e3d826b42e

openbox fork - make it a bit more like ryudo

fixed memory leaks for strftime_format and rootcommand
Scott Moynes smoynes@nexus.carleton.ca
commit

0a3cfdfcb956024639a05549a50586e3d826b42e

parent

bed4d7c1e55947b6c69480e33abc63c280c62471

1 files changed, 11 insertions(+), 4 deletions(-)

jump to
M src/Screen.ccsrc/Screen.cc

@@ -1192,9 +1192,13 @@ #ifdef HAVE_STRFTIME

rname.seekp(0); rclass.seekp(0); rname << rscreen.str() << "strftimeFormat" << ends; rclass << rscreen.str() << "StrftimeFormat" << ends; + + if (resource.strftime_format != NULL){ + delete [] resource.strftime_format; + resource.strftime_format=NULL; + } + if (config.getValue(rname.str(), rclass.str(), s)) { - if (resource.strftime_format != NULL) - delete [] resource.strftime_format; resource.strftime_format = bstrdup(s.c_str()); } #else // !HAVE_STRFTIME

@@ -1233,9 +1237,12 @@

rname.seekp(0); rclass.seekp(0); rname << rscreen.str() << "rootCommand" << ends; rclass << rscreen.str() << "RootCommand" << ends; + + if (resource.root_command != NULL){ + delete [] resource.root_command; + resource.root_command=NULL; + } if (config.getValue(rname.str(), rclass.str(), s)) { - if (resource.root_command != NULL) - delete [] resource.root_command; resource.root_command = bstrdup(s.c_str()); }