Coverity
authordainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jan 2012 11:22:26 +0000 (11:22 +0000)
committerdainese <dainese@f7af4fe6-9843-0410-8265-dc069ae4e863>
Fri, 20 Jan 2012 11:22:26 +0000 (11:22 +0000)
PWG3/vertexingHF/AliAODRecoDecayHF.cxx
PWG3/vertexingHF/AliCFVertexingHF.cxx

index 2d61e87..976825f 100644 (file)
@@ -146,14 +146,19 @@ AliAODRecoDecayHF &AliAODRecoDecayHF::operator=(const AliAODRecoDecayHF &source)
   fListOfCuts = source.fListOfCuts;
   fSelectionMap = source.fSelectionMap;
 
-  if(source.GetOwnPrimaryVtx()) fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
+  if(source.GetOwnPrimaryVtx()) {
+    delete fOwnPrimaryVtx;
+    fOwnPrimaryVtx = new AliAODVertex(*(source.GetOwnPrimaryVtx()));
+  }
 
   if(source.GetNProngs()>0) {
     if(source.fd0err) {
+      delete [] fd0err;
       fd0err = new Double_t[GetNProngs()];
       memcpy(fd0err,source.fd0err,GetNProngs()*sizeof(Double_t));
     }
     if(source.fProngID) {
+      delete [] fProngID;
       fProngID = new UShort_t[GetNProngs()];
       memcpy(fProngID,source.fProngID,GetNProngs()*sizeof(UShort_t));
     }
index 89235bc..c30210a 100644 (file)
@@ -140,8 +140,11 @@ AliCFVertexingHF& AliCFVertexingHF::operator=(const AliCFVertexingHF& c)
 
        if (this!= &c){
                TObject::operator=(c);
+               delete fmcArray;
                fmcArray = new TClonesArray(*(c.fmcArray));
+               delete fRecoCandidate;
                fRecoCandidate = new AliAODRecoDecayHF(*(c.fRecoCandidate));
+               delete fmcPartCandidate;
                fmcPartCandidate = new AliAODMCParticle(*(c.fmcPartCandidate));
                fNDaughters = c.fNDaughters;
                fNVar = c.fNVar;
@@ -158,6 +161,9 @@ AliCFVertexingHF& AliCFVertexingHF::operator=(const AliCFVertexingHF& c)
                fFake=c.fFake;
                fRejectIfNoQuark=c.fRejectIfNoQuark;
                if (fProngs > 0){
+                       delete [] fLabelArray;
+                       delete [] fPtAccCut;
+                       delete [] fEtaAccCut;
                        fLabelArray = new Int_t[fProngs];
                         fPtAccCut = new Float_t[fProngs];
                         fEtaAccCut = new Float_t[fProngs];