Skip to content
Snippets Groups Projects
Commit b6a707af authored by Scott Snyder's avatar Scott Snyder Committed by scott snyder
Browse files

LArCalibTools: Coverity 114238 114134 114139 114175 114194.

Coverity fixes: Potential memory leaks.


Former-commit-id: fe56e403
parent f5e519df
No related branches found
No related tags found
No related merge requests found
......@@ -62,7 +62,7 @@ StatusCode CaloCondBlob2Ntuple::stop () {
return StatusCode::SUCCESS;
}
const CaloCondBlobFlt* condBlob=CaloCondBlobFlt::getInstance(blob);
std::unique_ptr<const CaloCondBlobFlt> condBlob (CaloCondBlobFlt::getInstance(blob));
ATH_MSG_INFO("Database folder has values for " << condBlob->getNChans() << " channels and " << condBlob->getNGains() << " gains.");
......
......@@ -121,15 +121,15 @@ StatusCode LArAutoCorrFromStdNtuple::stop()
outfit->SetBranchAddress("covr", covr);
// Create new LArAutocorrContainer
LArAutoCorrComplete* larAutoCorrComplete = NULL ;
LArAutoCorrMC* larAutoCorrMC = NULL ;
std::unique_ptr<LArAutoCorrComplete> larAutoCorrComplete;
std::unique_ptr<LArAutoCorrMC> larAutoCorrMC;
if(m_isComplete) {
larAutoCorrComplete = new LArAutoCorrComplete();
larAutoCorrComplete = std::make_unique<LArAutoCorrComplete>();
ATH_CHECK( larAutoCorrComplete->setGroupingType(m_groupingType, msg()) );
ATH_CHECK( larAutoCorrComplete->initialize() );
} else {
larAutoCorrMC = new LArAutoCorrMC();
larAutoCorrMC = std::make_unique<LArAutoCorrMC>();
ATH_CHECK( larAutoCorrMC->setGroupingType(m_groupingType, msg()) );
ATH_CHECK( larAutoCorrMC->initialize() );
}
......@@ -248,12 +248,10 @@ StatusCode LArAutoCorrFromStdNtuple::stop()
}
if(m_isComplete) {
ATH_CHECK( detStore()->record(larAutoCorrComplete,m_store_key) );
ATH_CHECK( detStore()->symLink(larAutoCorrComplete,(ILArAutoCorr*)larAutoCorrComplete) );
ATH_CHECK( detStore()->record(std::move(larAutoCorrComplete),m_store_key) );
} else {
ATH_CHECK( detStore()->record(larAutoCorrMC,m_store_key) );
ATH_CHECK( detStore()->symLink(larAutoCorrMC,(ILArAutoCorr*)larAutoCorrMC) );
ATH_MSG_INFO ( "Stored container " << larAutoCorrMC->nGains() << "gains, " << larAutoCorrMC->totalNumberOfConditions() << " conditions, key: " << m_store_key );
ATH_CHECK( detStore()->record(std::move(larAutoCorrMC),m_store_key) );
}
return StatusCode::SUCCESS;
......
......@@ -94,15 +94,15 @@ StatusCode LArShapeFromStdNtuple::stop()
Int_t prevPhase=-1;
// Create new LArShapeContainer
LArShapeComplete* larShapeComplete = NULL ;
LArShape32MC* larShapeMC = NULL ;
std::unique_ptr<LArShapeComplete> larShapeComplete;
std::unique_ptr<LArShape32MC> larShapeMC;
if(m_isComplete) {
larShapeComplete = new LArShapeComplete();
larShapeComplete = std::make_unique<LArShapeComplete>();
ATH_CHECK( larShapeComplete->setGroupingType(m_groupingType, msg()) );
ATH_CHECK( larShapeComplete->initialize() );
} else {
larShapeMC = new LArShape32MC();
larShapeMC = std::make_unique<LArShape32MC>();
ATH_CHECK( larShapeMC->setGroupingType(m_groupingType, msg()) );
ATH_CHECK( larShapeMC->initialize() );
}
......@@ -225,13 +225,10 @@ StatusCode LArShapeFromStdNtuple::stop()
}
}
const ILArShape* larShape = NULL ;
if(m_isComplete) {
ATH_CHECK( detStore()->record(larShapeComplete,m_store_key) );
ATH_CHECK( detStore()->symLink(larShapeComplete,larShape) );
ATH_CHECK( detStore()->record(std::move(larShapeComplete),m_store_key) );
} else {
ATH_CHECK( detStore()->record(larShapeMC,m_store_key) );
ATH_CHECK( detStore()->symLink(larShapeMC,larShape) );
ATH_CHECK( detStore()->record(std::move(larShapeMC),m_store_key) );
}
return StatusCode::SUCCESS;
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment