Coverity
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Apr 2011 11:39:25 +0000 (11:39 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Wed, 6 Apr 2011 11:39:25 +0000 (11:39 +0000)
PWG3/vertexingHF/AliAnalysisTaskSEHFQA.cxx
PWG3/vertexingHF/AliAnalysisTaskSESignificance.cxx
PWG3/vertexingHF/AliCFTaskVertexingHF.cxx

index a767c00..815ac0d 100644 (file)
@@ -638,6 +638,11 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
   TClonesArray *mcArray = 0;
   AliAODMCHeader *mcHeader = 0;
 
+  if(!aod) {
+    delete [] pdgdaughters;
+    return;
+  }
+
   //check if MC
   if(fReadMC) {
     // load MC particles
@@ -656,10 +661,12 @@ void AliAnalysisTaskSEHFQA::UserExec(Option_t */*option*/)
       return;
     }
   }
-  if(!aod) {delete [] pdgdaughters;return;}
   // fix for temporary bug in ESDfilter 
   // the AODs with null vertex pointer didn't pass the PhysSel
-  if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) return;
+  if(!aod->GetPrimaryVertex() || TMath::Abs(aod->GetMagneticField())<0.001) {
+    delete [] pdgdaughters;
+    return;
+  }
 
   // count event
   fNEntries->Fill(0); 
index 3f7e741..5775934 100644 (file)
@@ -587,6 +587,7 @@ void AliAnalysisTaskSESignificance::UserExec(Option_t */*option*/)
        SetPDGdaughterDstopiKK();
        nVals=0;
        fRDCuts->GetCutVarsForOpt(d,fVars,fNVars,fPDGdaughters);
+       delete [] addresses;
        addresses = muvec->GetGlobalAddressesAboveCuts(fVars,(Float_t)d->Pt(),nVals);
        if(fDebug>1)printf("nvals = %d\n",nVals);
        for(Int_t ivals=0;ivals<nVals;ivals++){
index 87e70a6..d8947a5 100644 (file)
@@ -453,6 +453,8 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
        
        if (TMath::Abs(zMCVertex) > fCuts->GetMaxVtxZ()){
          AliDebug(3,Form("z coordinate of MC vertex = %f, it was required to be within [-%f, +%f], skipping event", zMCVertex, fCuts->GetMaxVtxZ(), fCuts->GetMaxVtxZ()));
+         delete[] containerInput;
+         delete[] containerInputMC;
          return;
        }
 
@@ -481,15 +483,14 @@ void AliCFTaskVertexingHF::UserExec(Option_t *)
        fCuts->SetTriggerClass("");
 
 
-       if (fCentralitySelection){
+       if (fCentralitySelection){ // consider only events in the class requested
          if(fCuts->IsEventSelectedInCentrality(aodEvent)!=0) {
            delete[] containerInput;
            delete[] containerInputMC;
             delete [] trackCuts;
             return;
           }    
-       }
-       else{
+       } else { // disable the centrality sel in IsEventSelected
          fCuts->SetUseCentrality(0);
        }