forked from mirror/go-sqlcipher
Avoid leaking db if setting busy timeout fails
This commit is contained in:
parent
b2e464529e
commit
4c2dc8806a
|
@ -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)}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue