aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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++ {