소스 검색

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)