]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
fix coverity defects
authorabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Dec 2010 10:05:12 +0000 (10:05 +0000)
committerabercuci <abercuci@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 20 Dec 2010 10:05:12 +0000 (10:05 +0000)
STAT/TKDInterpolatorBase.cxx
STAT/TKDNodeInfo.cxx

index ff847c9c694268fbf5b6cc7d4f79c5f8f750d71f..b4a2cc4bb64ec21a169a273dc8688fad7460078d 100644 (file)
@@ -240,6 +240,8 @@ Double_t TKDInterpolatorBase::Eval(const Double_t *point, Double_t &result, Doub
       Error("TKDInterpolatorBase::Eval()", Form("Interpolation failed and number of interpolation points (%d) Can not be increased further.", npoints));
       result = 0.;
       error = 1.E10;
+      // clean memory
+      delete [] dist; delete [] index;
       return 0.;
     } else npoints = npoints_new;
     if(npoints > GetNTNodes()){
index 915a688183b1d159cd91ed49ba14688d307f6d4f..1a1fa7494f0d5f523ed9744c8afa3fe9e3b7d8d2 100644 (file)
@@ -46,7 +46,7 @@ TKDNodeInfo::TKDNodeInfo(Int_t dim):
 //_________________________________________________________________
 TKDNodeInfo::TKDNodeInfo(const TKDNodeInfo &ref):
   TObject((TObject&) ref)
-  ,fNDim(fNDim)
+  ,fNDim(ref.fNDim)
   ,fData(NULL)
   ,fNpar(0)
   ,fNcov(0)
@@ -56,6 +56,7 @@ TKDNodeInfo::TKDNodeInfo(const TKDNodeInfo &ref):
   // Copy constructor
   Build(fNDim/3);
 
+  fData = new Float_t[fNDim];
   memcpy(fData, ref.fData, fNDim*sizeof(Float_t));
   fVal[0] = ref.fVal[0];
   fVal[1] = ref.fVal[1];