Fix Coverity reports
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Feb 2011 09:35:18 +0000 (09:35 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 14 Feb 2011 09:35:18 +0000 (09:35 +0000)
TTherminator/TTherminator.cxx
TTherminator/Therminator/Event.cxx
TTherminator/Therminator/Parser.cxx

index 4bb17d6..6fb0d96 100644 (file)
@@ -204,6 +204,8 @@ void        TTherminator::Initialize(){
        }
       in.close();
     }
+
+  delete tParser;
 }
 
 void        TTherminator::GenerateEvent()
index 0949c42..56b673e 100644 (file)
@@ -268,12 +268,13 @@ Event::ReadMultiplicities()
     while (!fin->eof())
     {
       (*fin) >> tName >> tMult;
-      PRINT_DEBUG_2(tName << " " <<  mDB->GetParticleTypeIndex(strdup(tName)) << " " << tMult);
+      PRINT_DEBUG_2(tName << " " <<  mDB->GetParticleTypeIndex(tName) << " " << tMult);
       mAverageMultiplicities[mDB->GetParticleTypeIndex(strdup(tName))] = tMult;
     }
     fin->close();
   }
 
+  delete tHash;
   delete tMultName;
 }
 
index 8a36863..72de7e3 100644 (file)
@@ -111,8 +111,8 @@ int Parser::GetParticleNumber(int i)
 void Parser::ReadInput()
 {
   int j,tPartIter=0,l,tIter2, tIter; //variables
-  char str[50];
-  char str1[20];
+  char str[200];
+  char str1[200];
   double spin1,spin2,value;
 
   //////  START OF "TABLES.M" /////////
@@ -342,6 +342,11 @@ void Parser::ReadInput()
            tRatio *= atof(tBRatio)/atof(tBRatio+2);
          else
            tRatio *= atof(tBRatio);
+
+         delete tFather;
+         delete tDaughter1;
+         delete tDaughter2;
+         delete tBRatio;
        }
 
       //THREE-BODY DECAYS
@@ -449,6 +454,8 @@ void Parser::ReadInput()
          //        (mDB->GetParticleType(tFather))->AddDecayChannel(*newChannel);
          //      }
          (mDB->GetParticleType(tFather))->AddDecayChannel(*newChannel);
+
+         delete newChannel;
        }
       
       if(str[0] == 's' && str[1] == 'e' && str[2] == '3')
@@ -637,6 +644,8 @@ void Parser::ReadShare()
                    mDB->GetParticleType(tDaughter3)->GetMass()
                    < mDB->GetParticleType(tFather)->GetMass())
                  (mDB->GetParticleType(tFather))->AddDecayChannel(*newChannel);
+
+               delete newChannel;
                
                tRatio=tBRatio;
                PRINT_DEBUG_2(tBRatio << '\t' << tRatio);