Memory leak during MySQL access
Original Reporter info from Mantis: bozox
-
Reporter name: Seva Alekseyev
Original Reporter info from Mantis: bozox
- Reporter name: Seva Alekseyev
Description:
Memory leaks when strings from a MySQL database are passed around in structures within dynamic arrays.
Steps to reproduce:
Create a MySQL database. Run the file leak.sql from the attached archive within that database. The file is in UTF-8.
Edit line 12 in leak.pas to reflect your MySQL connection info.
Compile the attached sources using the following command line:
fpc -Mdelphi leak.pas
Run and enjoy the view.
Additional information:
Replacing MySQL access with static string assignment removes the leak.
The sources were heavily pruned to isolate the behavior - still quite a bit of dead code. In production, the error manifests in a huge way. A workaround would be most welcome.
Mantis conversion info:
- Mantis ID: 15324
- OS: Win32, Linux
- OS Build: XP, Debian Lenny
- Platform: i386
- Version: 2.2.4
- Monitored by: » bozox (Seva Alekseyev)