Fix memory leak when sqlite3_open_v2 fails
According to SQLite documentation, a database connection handle
is usually returned, even if an error occurs. This behavior has
caused Qt to leak memory when opening a database is failed. Now,
even if sqlite3_open_v2() does not return SQLITE_OK, Qt tries to
release SQLite database handle by calling sqlite3_close().
Task-number: QTBUG-15773
Change-Id: I6538e2897216828a9cfb95b7d4a5cec437aa6c28
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
Reviewed-by: Andy Shaw <andy.shaw@digia.com>
Reviewed-by: Michael Goddard <michael.goddard@nokia.com>