1
0
Fork 0
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:
Kenichi Ishigaki 2009-10-18 06:03:53 +00:00
parent 03ae5523f0
commit 8e5e323bd2

View file

@ -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 ) {
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 */
}
DBIc_IMPSET_on(imp_dbh);