coverity mem leak corrected
authorgconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 09:57:25 +0000 (09:57 +0000)
committergconesab <gconesab@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 26 Apr 2011 09:57:25 +0000 (09:57 +0000)
PWG4/CaloCalib/AliAnalysisTaskEMCALClusterize.cxx

index 2eafe87..59c50f1 100644 (file)
@@ -516,7 +516,7 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
         for(Int_t icell=0; icell < clus->GetNCells(); icell++ ){
           fCellLabels[index[icell]]=label;
           fCellSecondLabels[index[icell]]=label2;
-          //printf("1) absID %d, label %d\n",index[icell], fCellLabels[index[icell]]);
+          //printf("1) absID %d, label[0] %d label[1] %d\n",index[icell], fCellLabels[index[icell]],fCellSecondLabels[index[icell]]);
         }
         nClustersOrg++;
       }
@@ -655,7 +655,11 @@ void AliAnalysisTaskEMCALClusterize::UserExec(Option_t *)
 //     }
 //    }
     
-    //printf("Cluster %d, energy %f\n",newCluster->GetID(),newCluster->E());
+//    printf("Cluster %d, energy %f\n",newCluster->GetID(),newCluster->E());
+//    printf("labels: ");
+//    for(UInt_t ilab = 0; ilab < newCluster->GetNLabels(); ilab++)
+//      printf("Label[%d]: %d ",ilab, newCluster->GetLabelAt(ilab)); 
+//     printf("\n ");
     
     newCluster->SetID(i);
     new((*fOutputAODBranch)[i])  AliAODCaloCluster(*newCluster);
@@ -874,8 +878,10 @@ void AliAnalysisTaskEMCALClusterize::RecPoints2Clusters(TClonesArray *digitsArr,
           for ( UInt_t iLoopNewLabels = 0 ; iLoopNewLabels < clus->GetNLabels() ; iLoopNewLabels++ ){
             newLabelArray[iLoopNewLabels] = clus->GetLabelAt(iLoopNewLabels) ;
           }
+
           newLabelArray[clus->GetNLabels()] = fCellSecondLabels[idCell] ;
           clus->SetLabel(newLabelArray,clus->GetNLabels()+1) ;
+          delete [] newLabelArray;
         }
       }//positive cell number
     }