From f1dd33e0526f72ccc9c3470ef6757d4dc38da901 Mon Sep 17 00:00:00 2001 From: Kenichi Ishigaki Date: Sun, 18 Oct 2009 08:51:59 +0000 Subject: [PATCH] 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 --- dbdimp.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dbdimp.c b/dbdimp.c index de880d5..661636c 100644 --- a/dbdimp.c +++ b/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 */ }