Skip to content

TSQLite3Connection potential memory leak

Summary

In TSQLite3Connection.UpdateIndexDefs(), when an exception is raised while executing the SQL statement, the 2 TStringLists are not freed.

System Information

  • Operating system: Arch Linux
  • Processor architecture: x86-64
  • Compiler version: 3.3.1-10634-gdea81f4f60
  • Device: Desktop computer

Steps to reproduce

Run the attached test project, open the query, then close.

Possible fixes

Attached proposed patch.

(Note: This patch just encloses the relevant code in a try..finally..end block.)

tsqlite3conn-memleak-test01.zip

tsqlite3conn-memleak-01.patch

To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information