From 4dce5a91c9a84bd3f967f7634dc55f6aed0152d0 Mon Sep 17 00:00:00 2001 From: Hubert Hirtz Date: Mon, 13 Sep 2021 16:59:41 +0200 Subject: [PATCH] Explicitly close connection to SQLite on failed upgrade --- db_sqlite.go | 1 + 1 file changed, 1 insertion(+) diff --git a/db_sqlite.go b/db_sqlite.go index 58ea072..6413acc 100644 --- a/db_sqlite.go +++ b/db_sqlite.go @@ -150,6 +150,7 @@ func OpenSqliteDB(driver, source string) (Database, error) { db := &SqliteDB{db: sqlSqliteDB} if err := db.upgrade(); err != nil { + sqlSqliteDB.Close() return nil, err }