Fix Coverity issues
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 08:53:48 +0000 (08:53 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 22 Mar 2011 08:53:48 +0000 (08:53 +0000)
TTherminator/AliGenTherminator.cxx
TTherminator/Therminator/Event.cxx
TTherminator/Therminator/Integrator.cxx
TTherminator/Therminator/Parser.cxx

index e4bc856..4f42251 100644 (file)
@@ -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);
       
index 99fee37..acda2f7 100644 (file)
@@ -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
index 4195b89..3b412ab 100644 (file)
@@ -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)
index a01f6b7..1645be8 100644 (file)
@@ -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 
                  {