Fix Coverity reports
authorakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Mar 2011 11:01:49 +0000 (11:01 +0000)
committerakisiel <akisiel@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 10 Mar 2011 11:01:49 +0000 (11:01 +0000)
TTherminator/Therminator/Event.cxx
TTherminator/Therminator/Parser.cxx

index 56b673e..99fee37 100644 (file)
@@ -269,7 +269,7 @@ Event::ReadMultiplicities()
     {
       (*fin) >> tName >> tMult;
       PRINT_DEBUG_2(tName << " " <<  mDB->GetParticleTypeIndex(tName) << " " << tMult);
-      mAverageMultiplicities[mDB->GetParticleTypeIndex(strdup(tName))] = tMult;
+      mAverageMultiplicities[mDB->GetParticleTypeIndex(tName)] = tMult;
     }
     fin->close();
   }
index 86c0ff2..ff00ba3 100644 (file)
@@ -514,6 +514,12 @@ void Parser::ReadInput()
          //          mDB->GetParticleType(tDaughter3)->GetMass()
          //          < mDB->GetParticleType(tFather)->GetMass())
          (mDB->GetParticleType(tFather))->AddDecayChannel(*newChannel);
+
+         delete tFather;
+         delete tDaughter1;
+         delete tDaughter2;
+         delete tDaughter3;
+         delete tBRatio;
        }
     }
 
@@ -711,6 +717,8 @@ void Parser::ReadShare()
                  {
                    
                    PRINT_DEBUG_2("Masses do not match! Not adding channel " << newChannel);
+
+                   delete newChannel;
                  }
              }
              else {