coverity fix (M. Verweij)
authorkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2011 08:12:34 +0000 (08:12 +0000)
committerkleinb <kleinb@f7af4fe6-9843-0410-8265-dc069ae4e863>
Thu, 13 Oct 2011 08:12:34 +0000 (08:12 +0000)
PWG4/JetTasks/AliPWG4HighPtTrackQA.cxx

index b9025c03fe81a1ba7eae690aecfbd954c3b6154e..7d40cd317caf2f54530c7fd27f19a961f1aeb9b4 100644 (file)
@@ -923,12 +923,11 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     //Get track for analysis
     AliESDtrack *track = 0x0;
     AliESDtrack *esdtrack = fESD->GetTrack(iTrack);
-    AliESDtrack *origtrack = new AliESDtrack(*esdtrack);
     if(!esdtrack) {
       fh1NTracksReject->Fill("noESDtrack",1);
-      if(origtrack) delete origtrack;
       continue;
     }
+    AliESDtrack *origtrack = new AliESDtrack(*esdtrack);
 
     if(fTrackType==4) {
       FillSystematicCutHist(esdtrack);
@@ -1117,6 +1116,7 @@ void AliPWG4HighPtTrackQA::DoAnalysisESD() {
     if(fTrackType==1  || fTrackType==2 || fTrackType==4 || fTrackType==5 || fTrackType==6 || fTrackType==7) {
       if(track) delete track;
     }
+    if(origtrack) delete origtrack;
     
   }//track loop