Fixing Coverity 18328
authorfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 09:27:30 +0000 (09:27 +0000)
committerfca <fca@f7af4fe6-9843-0410-8265-dc069ae4e863>
Mon, 16 Jan 2012 09:27:30 +0000 (09:27 +0000)
STEER/ESD/AliStrLine.cxx

index 3e08814..ae45106 100644 (file)
@@ -118,10 +118,14 @@ AliStrLine::AliStrLine(const Double_t *const point, const Double_t *const sig2po
 }
 
 //________________________________________________________
-AliStrLine::AliStrLine(const AliStrLine &source):TObject(source),
-fWMatrix(0),
-fTpar(source.fTpar){
+AliStrLine::AliStrLine(const AliStrLine &source):
+  TObject(source),
+  fWMatrix(0),
+  fTpar(source.fTpar)
+{
+  //
   // copy constructor
+  //
   for(Int_t i=0;i<3;i++){
     fP0[i]=source.fP0[i];
     fSigma2P0[i]=source.fSigma2P0[i];
@@ -135,11 +139,23 @@ fTpar(source.fTpar){
 }
 
 //________________________________________________________
-AliStrLine& AliStrLine::operator=(const AliStrLine& source){
+AliStrLine& AliStrLine::operator=(const AliStrLine& source)
+{
   // Assignment operator
   if(this !=&source){
-    this->~AliStrLine();
-    new(this)AliStrLine(source);
+    for(Int_t i=0;i<3;i++){
+      fP0[i]=source.fP0[i];
+      fSigma2P0[i]=source.fSigma2P0[i];
+      fCd[i]=source.fCd[i];
+    } 
+
+    delete [] fWMatrix;
+    fWMatrix=0;
+    if(source.fWMatrix){
+      fWMatrix = new Double_t [6];
+      for(Int_t i=0;i<6;i++)fWMatrix[i]=source.fWMatrix[i];
+    } 
+    for(Int_t i=0;i<2;i++) fIdPoint[i]=source.fIdPoint[i];
   }
   return *this;
 }