Fixing a little memory leak
authorbelikov <Iouri.Belikov@cern.ch>
Tue, 28 Oct 2014 17:09:49 +0000 (18:09 +0100)
committerbelikov <Iouri.Belikov@cern.ch>
Tue, 28 Oct 2014 17:09:49 +0000 (18:09 +0100)
ITS/UPGRADE/macros/QA/AliITSUComparisonPileup.C

index cfce1ca..34aa684 100644 (file)
@@ -201,7 +201,7 @@ Int_t AliITSUComparisonPileup(const Char_t *dir=".") {
      }
      Int_t ngood=refs->GetEntriesFast(); 
      cout<<"Found SPD vertices: "<<nfoundSPD<<
-           "  Reconstructable vertics: "<<ngood<<endl;
+           "  Reconstructable vertices: "<<ngood<<endl;
 
      h2spd->Fill(ngood,nfoundSPD);
      h2trk->Fill(ngood,nfoundTRK);
@@ -418,14 +418,14 @@ Int_t GoodPileupVertices(const Char_t *dir) {
          Float_t t=h->InteractionTime();
          UShort_t *idx=new UShort_t[np];
          Int_t ntrk=FindContributors(t,stack,idx);
-         if (ntrk < nMin) continue;
+         if (ntrk < nMin) {delete[] idx; continue;}
          AliESDVertex *vertex=new ((*refs)[nv]) AliESDVertex();
          vertex->SetXv(vtx[0]);
          vertex->SetYv(vtx[1]);
          vertex->SetZv(vtx[2]);
          vertex->SetNContributors(ntrk);
          vertex->SetIndices(ntrk,idx);
-         delete idx;
+         delete[] idx;
          nv++;
      }
      refTree.Fill();