浏览代码

HPCC-16438 Fix minor resource leak in configmgr reported by coverity

HPCC-16438 Fix minor resource leak in configmgr reported by coverity

- Delete possibly previously NEW'ed var before reassignment to avoid override
- Per code review comments, no need to check if NULL before delete
- Per code review comments, use delete directive rather than function
- Add comment explaining the unusual delete for ease of maintenance

Signed-off-by: Rodrigo Pastrana <rodrigo.pastrana@lexisnexis.com>
Rodrigo Pastrana 8 年之前
父节点
当前提交
f9ea54f9e1
共有 1 个文件被更改,包括 1 次插入0 次删除
  1. 1 0
      deployment/deployutils/wizardInputs.cpp

+ 1 - 0
deployment/deployutils/wizardInputs.cpp

@@ -316,6 +316,7 @@ CInstDetails* CWizardInputs::getServerIPMap(const char* compName, const char* bu
  
       if(m_compIpMap.find(buildSetName) != NULL)
       {
+        delete instDetails; // Possibly previously NEW'ed, delete to avoid override
         instDetails = m_compIpMap.getValue(buildSetName);
 
         if( (instDetails->getIpAssigned()).ordinality() != numOfNodes)