1
0
Fork 0
mirror of https://github.com/DBD-SQLite/DBD-SQLite synced 2025-06-08 14:48:32 -04:00

DBD::SQLite: if we fail to set a pragma and return undef, we can't use the handle anymore. so close it before we return

This commit is contained in:
Kenichi Ishigaki 2009-10-18 08:51:59 +00:00
parent ba00282533
commit f1dd33e052

View file

@ -102,6 +102,7 @@ sqlite_db_login(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char *pas
sqlite_error(dbh, (imp_xxh_t*)imp_dbh, retval, errmsg);
if (errmsg)
sqlite3_free(errmsg);
sqlite3_close(imp_dbh->db); / * we don't use this handle */
return FALSE; /* -> undef in lib/DBD/SQLite.pm */
}
@ -113,6 +114,7 @@ sqlite_db_login(SV *dbh, imp_dbh_t *imp_dbh, char *dbname, char *user, char *pas
sqlite_error(dbh, (imp_xxh_t*)imp_dbh, retval, errmsg);
if (errmsg)
sqlite3_free(errmsg);
sqlite3_close(imp_dbh->db); / * we don't use this handle */
return FALSE; /* -> undef in lib/DBD/SQLite.pm */
}