]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - EMCAL/AliEMCALTriggerTRU.cxx
Coverity fixes.
[u/mrichter/AliRoot.git] / EMCAL / AliEMCALTriggerTRU.cxx
index 72a540bf6a52c9ae0653a617d49a3e0810031817..db1d829b9f50823663708606a9feef4f9a151e18 100644 (file)
@@ -227,6 +227,13 @@ Int_t AliEMCALTriggerTRU::L0()
                if (!nPeaks)
                {
                        ZeroRegion();
+
+                       for (Int_t x = 0; x < xsize; x++)
+                       {
+                         delete [] peaks[x];
+                       }
+                       delete [] peaks;
+
                        continue;
                }
                
@@ -278,6 +285,8 @@ Int_t AliEMCALTriggerTRU::L0()
                                }
                        }
                        
+                       delete [] idx;
+
                        if ( !foundPeak ) 
                        {
                                fPatches->RemoveAt( j );
@@ -327,9 +336,13 @@ Int_t AliEMCALTriggerTRU::L0()
 //________________
 void AliEMCALTriggerTRU::SetADC( Int_t channel, Int_t bin, Int_t sig )
 {
-       //
-       if (channel>95) AliError("TRU has 96 ADC channels only!");
-       fADC[channel][bin] = sig;
+  //Set ADC value
+  if (channel > 95 || bin > 255) {
+    AliError("TRU has 96 ADC channels and 256 bins only!");
+  }
+  else{ 
+    fADC[channel][bin] = sig;
+  }
 }
 
 //________________