You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafodion.apache.org by sv...@apache.org on 2019/02/08 17:26:17 UTC
[trafodion] branch master updated: [TRAFODION-3271] Fix memory leak
in environment variable processing
This is an automated email from the ASF dual-hosted git repository.
svarnau pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafodion.git
The following commit(s) were added to refs/heads/master by this push:
new eb31440 [TRAFODION-3271] Fix memory leak in environment variable processing
new 2ec0e2f Merge pull request #1789 from svarnau/j3271
eb31440 is described below
commit eb31440a83bfd7f8f6077afd934a2571a8c3a4f8
Author: Steve Varnau <sv...@apache.org>
AuthorDate: Tue Feb 5 18:34:00 2019 +0000
[TRAFODION-3271] Fix memory leak in environment variable processing
---
core/sqf/monitor/linux/monitor.cxx | 1 +
core/sqf/monitor/linux/process.cxx | 1 +
core/sqf/monitor/linux/shell.cxx | 1 +
3 files changed, 3 insertions(+)
diff --git a/core/sqf/monitor/linux/monitor.cxx b/core/sqf/monitor/linux/monitor.cxx
index d14590b..6638c4f 100755
--- a/core/sqf/monitor/linux/monitor.cxx
+++ b/core/sqf/monitor/linux/monitor.cxx
@@ -1391,6 +1391,7 @@ int main (int argc, char *argv[])
strcat(envfile, "/monitor.env");
#endif
xprops.load( envfile );
+ delete [] envfile;
MON_Smap_Enum xenum( &xprops );
while ( xenum.more( ) )
{
diff --git a/core/sqf/monitor/linux/process.cxx b/core/sqf/monitor/linux/process.cxx
index c8b544c..2a60313 100644
--- a/core/sqf/monitor/linux/process.cxx
+++ b/core/sqf/monitor/linux/process.cxx
@@ -2214,6 +2214,7 @@ bool CProcess::Create (CProcess *parent, void* tag, int & result)
strcpy(envfile, trafVar_.c_str());
strcat(envfile, "/mon.env");
xprops.load(envfile);
+ delete [] envfile;
MON_Smap_Enum xenum(&xprops);
if (xenum.more())
{
diff --git a/core/sqf/monitor/linux/shell.cxx b/core/sqf/monitor/linux/shell.cxx
index 1c80c10..c36c70b 100644
--- a/core/sqf/monitor/linux/shell.cxx
+++ b/core/sqf/monitor/linux/shell.cxx
@@ -5762,6 +5762,7 @@ bool start_monitor( char *cmd_tail, bool warmstart, bool reintegrate )
strcpy(envfile, sqvar);
strcat(envfile, "/shell.env");
xprops.load(envfile);
+ delete [] envfile;
MON_Smap_Enum xenum(&xprops);
int xsize = xprops.size();
int xinx;