Memory leak in chmreader
Original Reporter info from Mantis: wp @wpam
-
Reporter name:
Original Reporter info from Mantis: wp @wpam
- Reporter name:
Description:
Recompiling lhelp with activated heaptrc reveals a memory leak in unit chmreader:
Procedure "TChmReader.ReadCommonData" contains two nested procedures "ReadFromWindows" and "ReadContextIDs". In both of them, two MemoryStreams (fWindows and fStrings in ReadFromWindows, and fIVB and fStrings in ReadContextIDs) are created by the function "TITSFReader.GetObject", but never destroyed again (at least in the regular case that the procedures are exited at their end.)
Adding the corresponding fWindows.Free, fStrings.Free, and fIVB.Free removes the memory leak.
Additional information:
Patch provided.
Mantis conversion info:
- Mantis ID: 34216
- Fixed in version: 3.3.1
- Fixed in revision: 39706 (#d8e483dd)
- Monitored by: » Vincent (Vincent Snijders)
- Target version: 3.2.0