Skip to content
This repository was archived by the owner on Aug 31, 2021. It is now read-only.

Commit 019afc6

Browse files
committed
Merge remote-tracking branch 'origin/develop-9.0' into merge-develop_9.0_20.04.19
2 parents abd69c0 + b844848 commit 019afc6

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

libsqlite/src/sqlitedataset.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -426,7 +426,17 @@ int SqliteDatabase::connect(bool p_use_uri)
426426
return DB_CONNECTION_OK;
427427
}
428428
else
429+
{
430+
/* sqlite3_open will still create a connection object even if there is an
431+
* error - unless it runs out of memory, in which case the connection
432+
* pointer will be nullptr. */
433+
if (conn != nullptr)
434+
{
435+
sqlite3_close(conn);
436+
conn = nullptr;
437+
}
429438
throw DbErrors(getErrorMsg());
439+
}
430440

431441
return DB_CONNECTION_NONE;
432442
};

0 commit comments

Comments
 (0)