From a554cf198fe0b1a80f528fec6f892b60b7004da5 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Sat, 7 Jan 2017 22:22:02 +0900 Subject: [PATCH] close statement --- sqlite3.go | 1 + 1 file changed, 1 insertion(+) 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++ {