From 5c85bc96ca2128c202831bb97fe4139dcd569a27 Mon Sep 17 00:00:00 2001 From: cblume Date: Wed, 19 Jan 2011 16:23:02 +0000 Subject: [PATCH] Fix coverity defects --- TRD/Cal/AliTRDCalDet.cxx | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/TRD/Cal/AliTRDCalDet.cxx b/TRD/Cal/AliTRDCalDet.cxx index 94af75ae293..dfee42fbd86 100644 --- a/TRD/Cal/AliTRDCalDet.cxx +++ b/TRD/Cal/AliTRDCalDet.cxx @@ -179,7 +179,7 @@ Double_t AliTRDCalDet::GetRMSRobust(Double_t robust) const // // sorted - Int_t *index = new Int_t[kNdet]; + Int_t *index = new Int_t[kNdet+1]; TMath::Sort((Int_t)kNdet,fData,index); // reject @@ -542,8 +542,8 @@ Double_t AliTRDCalDet::CalcMean(Bool_t wghtPads) Double_t meanWP = 0.0; Double_t pads=0.0; Double_t padsALL=(144*16*24+144*12*6)*18; - Double_t meanSM[18]; - Double_t meanSMWP[18]; + Double_t *meanSM = new Double_t[18]; + Double_t *meanSMWP = new Double_t[18]; Int_t det = 0; while(det < 540) { @@ -594,5 +594,8 @@ Double_t AliTRDCalDet::CalcMean(Bool_t wghtPads) det++; } + delete []meanSM; + delete []meanSMWP; + return (sum/ndet); } -- 2.31.1