aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYasuhiro Matsumoto <mattn.jp@gmail.com>2017-01-07 22:22:02 +0900
committerYasuhiro Matsumoto <mattn.jp@gmail.com>2017-01-07 22:22:02 +0900
commita554cf198fe0b1a80f528fec6f892b60b7004da5 (patch)
tree32dd69c1d973646af6179eb50e6f659e8dc7de76
parentfix race condition (diff)
downloadgolite-a554cf198fe0b1a80f528fec6f892b60b7004da5.tar.gz
golite-a554cf198fe0b1a80f528fec6f892b60b7004da5.tar.xz
close statement
-rw-r--r--sqlite3.go1
1 files changed, 1 insertions, 0 deletions
diff --git a/sqlite3.go b/sqlite3.go
index a11e990..efb50b9 100644
--- a/sqlite3.go
+++ b/sqlite3.go
@@ -429,6 +429,7 @@ func (c *SQLiteConn) exec(ctx context.Context, query string, args []namedValue)
if s.(*SQLiteStmt).s != nil {
na := s.NumInput()
if len(args) < na {
+ s.Close()
return nil, fmt.Errorf("Not enough args to execute query. Expected %d, got %d.", na, len(args))
}
for i := 0; i < na; i++ {