diff --git a/sqlite3.go b/sqlite3.go index cbde900..d84e6ac 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -609,6 +609,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) { rv = C.sqlite3_busy_timeout(db, C.int(busyTimeout)) if rv != C.SQLITE_OK { + C.sqlite3_close_v2(db) return nil, Error{Code: ErrNo(rv)} }