summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorScott Moynes <smoynes@nexus.carleton.ca>2002-04-20 15:28:14 +0000
committerScott Moynes <smoynes@nexus.carleton.ca>2002-04-20 15:28:14 +0000
commit0a3cfdfcb956024639a05549a50586e3d826b42e (patch)
tree3db2694509f6a774e695d17ced55c20fb1f80f3f /src
parentbed4d7c1e55947b6c69480e33abc63c280c62471 (diff)
fixed memory leaks for strftime_format and rootcommand
Diffstat (limited to 'src')
-rw-r--r--src/Screen.cc15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/Screen.cc b/src/Screen.cc
index 8ad57376..0548f5ac 100644
--- a/src/Screen.cc
+++ b/src/Screen.cc
@@ -1192,9 +1192,13 @@ void BScreen::load() {
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 @@ void BScreen::load() {
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());
}