Browse Source

HPCC-21698 Resolve valgrind-reported errors and leaks

* Catch and release IException pointer.
* Set Boolean default values to false to eliminate numerous reported errors.

Signed-off-by: Tim Klemm <Tim.Klemm@lexisnexisrisk.com>
Tim Klemm 6 years ago
parent
commit
176cb6b4ea
3 changed files with 10 additions and 5 deletions
  1. 3 3
      esp/esdllib/esdl_transformer2.ipp
  2. 5 0
      esp/platform/espcfg.cpp
  3. 2 2
      esp/platform/espcfg.ipp

+ 3 - 3
esp/esdllib/esdl_transformer2.ipp

@@ -135,11 +135,11 @@ protected:
     StringAttr param_group;
 
     Esdl2Base* data_for; // only support one for now.
-    bool m_hasDataFrom;
+    bool m_hasDataFrom = false;
 
     bool might_skip_root;
-    bool count_output;
-    bool count_value;
+    bool count_output = false;
+    bool count_value = false;
 
 public:
     Esdl2Base(Esdl2Transformer *xformer, IEsdlDefObject* def, EsdlBasicElementType t=ESDLT_UNKOWN, bool might_skip_root_=false);

+ 5 - 0
esp/platform/espcfg.cpp

@@ -308,6 +308,11 @@ CEspConfig::CEspConfig(IProperties* inputs, IPropertyTree* envpt, IPropertyTree*
             else
                 ESPLOG(LogMin, "ESP Process [%s] configuration is missing '@directory' attribute, could not read AttachState", m_process.str());
         }
+        catch (IException* e)
+        {
+            e->Release();
+            ESPLOG(LogMin, "Could not load DALI Attach state file [%s] for ESP process [%s]", m_daliAttachStateFileName.str(), m_process.str());
+        }
         catch (...)
         {
            ESPLOG(LogMin, "Could not load DALI Attach state file [%s] for ESP process [%s]", m_daliAttachStateFileName.str(), m_process.str());

+ 2 - 2
esp/platform/espcfg.ipp

@@ -156,8 +156,8 @@ private:
     HINSTANCE hsami_;
     CSDSServerStatus *serverstatus;
     bool useDali;
-    bool m_detachedFromDali;
-    bool m_subscribedToDali;
+    bool m_detachedFromDali = false;
+    bool m_subscribedToDali = false;
     StringBuffer m_daliAttachStateFileName;
 
 private: