diff options
author | mattn <mattn.jp@gmail.com> | 2017-04-02 23:10:16 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-04-02 23:10:16 +0900 |
commit | c935ccca28b8b17e0a0d885c1b20a07dd829371e (patch) | |
tree | 83bce9d1a36b0278d71f2191c45a341b17904a42 | |
parent | Merge pull request #398 from mkungla/qfe1 (diff) | |
parent | Avoid leaking db if setting busy timeout fails (diff) | |
download | golite-c935ccca28b8b17e0a0d885c1b20a07dd829371e.tar.gz golite-c935ccca28b8b17e0a0d885c1b20a07dd829371e.tar.xz |
Merge pull request #406 from zombiezen/fixleak
Avoid leaking db if setting busy timeout fails
-rw-r--r-- | sqlite3.go | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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)} } |