]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - TTherminator/Therminator/Parser.cxx
Fix Coverity
[u/mrichter/AliRoot.git] / TTherminator / Therminator / Parser.cxx
index a01f6b7370b641c4336cdd31bbeb08da8eadbbe6..6c4d5d3b35bceaec43fead43ceda019043f4cbc4 100644 (file)
@@ -299,7 +299,7 @@ void Parser::ReadInput()
       if(str[0] == 's' && str[1] == 'e' && str[2] == '[')
        {
          // Reading in the decay channels
-         char *tLBrackert, *tFirstComma, *tSecondComma, *tThirdComma, *tRBracket;
+         char *tLBrackert=NULL, *tFirstComma=NULL, *tSecondComma=NULL, *tThirdComma=NULL, *tRBracket=NULL;
          
          tLBrackert = strchr(str,'[');
          tFirstComma = strchr(str,',');
@@ -307,7 +307,7 @@ void Parser::ReadInput()
          tThirdComma = strchr(tSecondComma+1,',');
          tRBracket = strchr(tThirdComma,']');
 
-         if (!(tLBrackert && tFirstComma && tSecondComma && tThirdComma && tRBracket))
+         if (!((tLBrackert != NULL) && (tFirstComma != NULL) && (tSecondComma != NULL) && ( tThirdComma != NULL) && (tRBracket!= NULL)))
            PRINT_DEBUG_1("Malformed line!: " << str);
          
          char *tFather = new char[tFirstComma-tLBrackert];
@@ -525,6 +525,8 @@ void Parser::ReadInput()
          delete [] tDaughter2;
          delete [] tDaughter3;
          delete [] tBRatio;
+
+         delete newChannel;
        }
     }
 
@@ -588,6 +590,8 @@ void Parser::ReadShare()
          tPartBuf->SetPDGCode((int) mc);
          tPartBuf->SetNumber(number);
          tNum = mDB->AddParticleType(tPartBuf);
+
+         delete tPartBuf;
        }
       in.close();
     }
@@ -717,6 +721,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 
                  {