fix: out-of-memory error in call to sqlite3_open() on a non-existent SQLite database file

Closes #1367
This commit is contained in:
Ansgar Becker
2026-02-19 18:44:01 +01:00
parent 42e5277be9
commit e93924f604

View File

@@ -2833,6 +2833,10 @@ begin
MainFile := IfThen(FileNames.Count>=1, FileNames[0], '');
if Value then begin
// Fixes "out of memory" crash in sqlite3_open, see issue #1367
if not FileExists(MainFile) then
raise EDbError.Create(f_('File does not exist: %s', [MainFile]));
DoBeforeConnect;
ConnectResult := FLib.sqlite3_open(