Avoid leaking db if setting busy timeout fails

notify
Ross Light 2017-04-01 08:53:17 -07:00
parent b2e464529e
commit 4c2dc8806a
1 changed files with 1 additions and 0 deletions

View File

@ -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)}
}