Fixes for coverity.
authorzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Sep 2010 14:24:10 +0000 (14:24 +0000)
committerzampolli <zampolli@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 15 Sep 2010 14:24:10 +0000 (14:24 +0000)
TOF/AliTOFcalib.cxx

index 17b3c4c..18bf558 100644 (file)
@@ -948,12 +948,10 @@ void AliTOFcalib::CreateTreeFromCDB(Int_t minrun, Int_t maxrun){
       AliInfo(Form("No entry found for run %i",irun));
     }
     else{
-      TTree *tree = new TTree();
-      tree = (TTree*)entry->GetObject();
+      TTree *tree = (TTree*)entry->GetObject();
       tree->SetBranchAddress("nentries",&nentries);
       tree->SetBranchAddress("TOFentries",p);      
       fTree->CopyEntries(tree);
-      delete tree;
       fNruns++;
     }
   }
@@ -1510,8 +1508,7 @@ Int_t AliTOFcalib::CalibrateFromProfile(Int_t ich, Option_t *optionSave, Option_
     return 2;
   }
 
-  TH1F * hProf = new TH1F();
-  hProf = Profile(ich);
+  TH1F * hProf = Profile(ich);
   hProf->Fit("pol5",optionFit,"",0,4);
   TF1 * calibfunc = (TF1*)hProf->GetFunction("pol5");
   Float_t par[6];