mirror of
https://github.com/DBD-SQLite/DBD-SQLite
synced 2025-06-07 22:28:47 -04:00
DBD::SQLite: sqlite API doc suggests to close the handle you tried to open but failed anyway
This commit is contained in:
parent
03ae5523f0
commit
8e5e323bd2
1 changed files with 4 additions and 0 deletions
4
dbdimp.c
4
dbdimp.c
|
@ -80,6 +80,10 @@ sqlite_db_login(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char *pas
|
||||||
|
|
||||||
if ((retval = sqlite3_open(dbname, &(imp_dbh->db))) != SQLITE_OK ) {
|
if ((retval = sqlite3_open(dbname, &(imp_dbh->db))) != SQLITE_OK ) {
|
||||||
sqlite_error(dbh, (imp_xxh_t*)imp_dbh, retval, (char*)sqlite3_errmsg(imp_dbh->db));
|
sqlite_error(dbh, (imp_xxh_t*)imp_dbh, retval, (char*)sqlite3_errmsg(imp_dbh->db));
|
||||||
|
if (imp_dbh->db) {
|
||||||
|
/* close the handle anyway */
|
||||||
|
sqlite3_close(imp_dbh->db);
|
||||||
|
}
|
||||||
return FALSE; /* -> undef in lib/DBD/SQLite.pm */
|
return FALSE; /* -> undef in lib/DBD/SQLite.pm */
|
||||||
}
|
}
|
||||||
DBIc_IMPSET_on(imp_dbh);
|
DBIc_IMPSET_on(imp_dbh);
|
||||||
|
|
Loading…
Add table
Reference in a new issue