Skip to content

Commit c935ccc

Browse files
authored
Merge pull request #406 from zombiezen/fixleak
Avoid leaking db if setting busy timeout fails
2 parents b2e4645 + 4c2dc88 commit c935ccc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

sqlite3.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -609,6 +609,7 @@ func (d *SQLiteDriver) Open(dsn string) (driver.Conn, error) {
609609

610610
rv = C.sqlite3_busy_timeout(db, C.int(busyTimeout))
611611
if rv != C.SQLITE_OK {
612+
C.sqlite3_close_v2(db)
612613
return nil, Error{Code: ErrNo(rv)}
613614
}
614615

0 commit comments

Comments
 (0)