From 6750cf946f12715cafdb1980e7c94e2de2beed78 Mon Sep 17 00:00:00 2001 From: akisiel Date: Tue, 22 Mar 2011 08:53:48 +0000 Subject: [PATCH] Fix Coverity issues --- TTherminator/AliGenTherminator.cxx | 4 ++-- TTherminator/Therminator/Event.cxx | 4 ++++ TTherminator/Therminator/Integrator.cxx | 7 ++++++- TTherminator/Therminator/Parser.cxx | 3 +++ 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/TTherminator/AliGenTherminator.cxx b/TTherminator/AliGenTherminator.cxx index e4bc856cb6b..4f42251c486 100644 --- a/TTherminator/AliGenTherminator.cxx +++ b/TTherminator/AliGenTherminator.cxx @@ -199,10 +199,10 @@ void AliGenTherminator::Generate() origin[2] = iparticle->Vz(); imo = -1; - TParticle* mother = 0; + // TParticle* mother = 0; if (hasMother) { imo = iparticle->GetFirstMother(); - mother = (TParticle *) fParticles.At(imo); + // mother = (TParticle *) fParticles.At(imo); } // if has mother Bool_t tFlag = (hasDaughter); diff --git a/TTherminator/Therminator/Event.cxx b/TTherminator/Therminator/Event.cxx index 99fee37f29d..acda2f7cdeb 100644 --- a/TTherminator/Therminator/Event.cxx +++ b/TTherminator/Therminator/Event.cxx @@ -311,12 +311,16 @@ Event::DecayParticles() #ifdef _NO_THREE_BODY_DECAYS_ if (tPart3){ tCount++; + if (tPart1) delete tPart1; + if (tPart2) delete tPart2; continue; } #endif #ifdef _OMIT_TWO_BODY_ if (tPart1 && tPart2 && !tPart3){ tCount++; + delete tPart1; + delete tPart2; continue; } #endif diff --git a/TTherminator/Therminator/Integrator.cxx b/TTherminator/Therminator/Integrator.cxx index 4195b89804f..3b412ab0346 100644 --- a/TTherminator/Therminator/Integrator.cxx +++ b/TTherminator/Therminator/Integrator.cxx @@ -40,7 +40,10 @@ Integrator::Integrator(int aNpart) kFmToGev = 0.197326960277; /*MCH updated: kFmToGev = 0.197;*/ ReadParameters(); - PRINT_MESSAGE("Hash for these parameters is: " << ParameterHash()); + char *tHash; + tHash = ParameterHash(); + + PRINT_MESSAGE("Hash for these parameters is: " << tHash); mNPart = aNpart; kTwoPi2 = TMath::Pi()*TMath::Pi()*2*2; /*MCH*/ @@ -50,6 +53,8 @@ Integrator::Integrator(int aNpart) mRandom->SetSeed(41321); mFOHS = new Hypersurface(mFOHSlocation.Data()); /*MCH*/ + + free (tHash); } double Integrator::CalcBE(double aX) diff --git a/TTherminator/Therminator/Parser.cxx b/TTherminator/Therminator/Parser.cxx index a01f6b7370b..1645be8b820 100644 --- a/TTherminator/Therminator/Parser.cxx +++ b/TTherminator/Therminator/Parser.cxx @@ -525,6 +525,8 @@ void Parser::ReadInput() delete [] tDaughter2; delete [] tDaughter3; delete [] tBRatio; + + delete newChannel; } } @@ -717,6 +719,7 @@ void Parser::ReadShare() { (mDB->GetParticleType(tFather))->AddDecayChannel(*newChannel); PRINT_DEBUG_2("Added channel " << newChannel << " " << mDB->GetParticleTypeIndex(tFather) << " " << mDB->GetParticleTypeIndex(tDaughter1) << " " << mDB->GetParticleTypeIndex(tDaughter2)); + delete newChannel; } else { -- 2.39.3