]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Attempt of coverity fix
authorscompar <scompar@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jan 2013 16:06:15 +0000 (16:06 +0000)
committerscompar <scompar@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 16 Jan 2013 16:06:15 +0000 (16:06 +0000)
PWG/muondep/AliAnalysisTaskESDMCLabelAddition.cxx

index 9c18473b663b156832372fb6411e6cdc07323235..cd70fe3c9c76b37d9d24affefc99565ddd1126cb 100644 (file)
@@ -460,6 +460,7 @@ Int_t AliAnalysisTaskESDMCLabelAddition::IsDecayByLabel(const AliMUONTrack &trac
   /// "lastCh" contains the chamber Id of the most downstream chamber hit by the decay chain
   
   Int_t nClusters = track.GetNClusters();
+  if (nClusters <= 0) return -1;
   Int_t *chId = new Int_t[nClusters];
   Int_t *labels = new Int_t[nClusters];
   
@@ -488,6 +489,7 @@ Int_t AliAnalysisTaskESDMCLabelAddition::IsDecayByPosition(const AliMUONTrack &t
   /// All possible combinations of compatible clusters from every trackRefs are considered
   
   Int_t nClusters = track.GetNClusters();
+  if (nClusters <= 0) return -1;
   Int_t *chId = new Int_t[nClusters];
   Int_t *nLabels = new Int_t[nClusters];
   TArrayI *labels = new TArrayI[nClusters];