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:
parent
ba00282533
commit
f1dd33e052
1 changed files with 2 additions and 0 deletions
2
dbdimp.c
2
dbdimp.c
|
@ -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 */
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue