memory leak in the unpacking of compressed HLT TPC clusters fixed
authorrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 23 Oct 2011 09:24:04 +0000 (09:24 +0000)
committerrichterm <richterm@f7af4fe6-9843-0410-8265-dc069ae4e863>
Sun, 23 Oct 2011 09:24:04 +0000 (09:24 +0000)
HLT/TPCLib/comp/AliHLTTPCDataCompressionDecoder.h

index 445ed01..a2b8aa7 100644 (file)
@@ -76,15 +76,15 @@ int AliHLTTPCDataCompressionDecoder::ReadRemainingClustersCompressed(T& c, const
   default:
     return -EBADF;
   }
-  AliHLTDataInflater* inflater=CreateInflater(deflaterMode, 1);
-  if (!inflater) return -ENODEV;
+  std::auto_ptr<AliHLTDataInflater> inflater(CreateInflater(deflaterMode, 1));
+  if (!inflater.get()) return -ENODEV;
 
   if ((iResult=inflater->InitBitDataInput(reinterpret_cast<const AliHLTUInt8_t*>(clusterData->fClusters),
                                          size-sizeof(AliHLTTPCRawClusterData)))<0) {
     return iResult;
   }
 
-  iResult=ReadRemainingClustersCompressed(c, inflater, nCount, specification, formatVersion);
+  iResult=ReadRemainingClustersCompressed(c, inflater.get(), nCount, specification, formatVersion);
 
   return iResult;
 }