]> git.uio.no Git - u/mrichter/AliRoot.git/commitdiff
Coverity defects (next round)
authorcblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 09:11:03 +0000 (09:11 +0000)
committercblume <cblume@f7af4fe6-9843-0410-8265-dc069ae4e863>
Tue, 9 Nov 2010 09:11:03 +0000 (09:11 +0000)
TRD/AliTRDptrgCBB.cxx
TRD/AliTRDptrgFEB.cxx
TRD/AliTRDptrgParam.cxx

index 9c3681955386c5b49f1867a6f76aaefa80ee30c6..2d285e08917eb4d8b49e3becaef56ea8dbe1c3da 100644 (file)
@@ -158,6 +158,7 @@ Bool_t AliTRDptrgCBB::LoadParams()
       }
       lut->InitTable(12, 12, initData, kTRUE); // make a copy 
     }
+    delete [] initData;
 
     AliTRDptrgParam::AliTRDptrgPTmasks* masks = 
       new AliTRDptrgParam::AliTRDptrgPTmasks();  
index a0effbd971d2ac66222b1e9462d2d2b1dd43be76..60e15fed635e913eaedb1a8c7a049643420f0869 100644 (file)
@@ -305,6 +305,7 @@ Bool_t AliTRDptrgFEB::LoadParams()
         }
         lut->InitTable(8, 8, initData, kTRUE);
       }
+      delete [] initData;
     }
     else {
       // initialize threshold
@@ -335,7 +336,7 @@ Bool_t AliTRDptrgFEB::LoadParams()
         }
         lut->InitTable(12, 12, initData, kTRUE); // make a copy of the table
       }
-      delete[] initData;    
+      delete [] initData;    
     }
     return false;
   }
index d1160b7698a2b77f33d9301baa6c7182a667f7bd..e4de883d0315e1210e00cdf1d9dc7d3561ba1df4 100644 (file)
@@ -1499,15 +1499,20 @@ Bool_t AliTRDptrgParam::ParseTLMU(TString identifier, TString value) {
     for (Int_t iEntry = 0; iEntry < arr.GetEntries(); iEntry++) {
 
       TObjString *ostrng = dynamic_cast<TObjString*>(arr[iEntry]);
-      TString t = ostrng->GetString(); 
+      if (ostrng) {
+
+        TString t = ostrng->GetString(); 
       
-      TString indexStr = t(2,1);
-      if (t.Index("CM") == 0) { // coincidence matrix
-        this->fTLMUoutput[iEntry][0] = indexStr.Atoi();
-      }
-      else if (t.Index("MC") == 0) { // multiplicity
-        this->fTLMUoutput[iEntry][1] = indexStr.Atoi();
+        TString indexStr = t(2,1);
+        if (t.Index("CM") == 0) { // coincidence matrix
+          this->fTLMUoutput[iEntry][0] = indexStr.Atoi();
+        }
+        else if (t.Index("MC") == 0) { // multiplicity
+          this->fTLMUoutput[iEntry][1] = indexStr.Atoi();
+        }
+
       }
+
       AliDebug(5, Form("TLMU output: cm = %d, mc = %d", 
                        this->fTLMUoutput[iEntry][0], 
                        this->fTLMUoutput[iEntry][1]));
@@ -1900,29 +1905,36 @@ Int_t* AliTRDptrgParam::GenerateLUTbasedOnEq(TString eq, Int_t inputWidth,
  
   ConvertLogicalEqToBitVectors(eq, results, signalsInvolved);
   // generate bit vectors
+  
+  if ((results != 0x0) && (signalsInvolved != 0x0)) {
 
-  CheckSignalsInvolved(results, signalsInvolved, inputWidth);
-  // add bit vectors for signals which are not taken into account
+    CheckSignalsInvolved(results, signalsInvolved, inputWidth);
+    // add bit vectors for signals which are not taken into account
 
-  Int_t lutSize =  0x1 << inputWidth; // 2^inputwidth elements
-  Int_t* resultingLUT = new Int_t[lutSize]; // create LUT
-  for (Int_t iLUTentry = 0; iLUTentry < lutSize; iLUTentry++) { // init LUT
-    resultingLUT[iLUTentry] = 0;
-  }
-  for (Int_t iEntry = 0; iEntry < results->GetSize(); iEntry++) {
-    resultingLUT[(*results)[iEntry]] = initValue;
-  }
+    Int_t lutSize =  0x1 << inputWidth; // 2^inputwidth elements
+    Int_t* resultingLUT = new Int_t[lutSize]; // create LUT
+    for (Int_t iLUTentry = 0; iLUTentry < lutSize; iLUTentry++) { // init LUT
+      resultingLUT[iLUTentry] = 0;
+    }
+    for (Int_t iEntry = 0; iEntry < results->GetSize(); iEntry++) {
+      resultingLUT[(*results)[iEntry]] = initValue;
+    }
   
-  if (results != 0x0) {
     delete results;
     results = 0x0;
-  }
-  if (signalsInvolved != 0x0) {
+
     delete signalsInvolved;
     signalsInvolved = 0x0;
-  }
   
-  return resultingLUT;
+    return resultingLUT;
+
+  }
+  else {
+
+    return 0x0;
+
+  }
+
 }
 
 //______________________________________________________________________________