Skip to content

Commit 82bc911

Browse files
committed
close statement when missing query arguments
fixes #1280
1 parent 846fea6 commit 82bc911

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
@@ -929,6 +929,7 @@ func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.Name
929929
s.(*SQLiteStmt).cls = true
930930
na := s.NumInput()
931931
if len(args)-start < na {
932+
s.Close()
932933
return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start)
933934
}
934935
// consume the number of arguments used in the current

0 commit comments

Comments
 (0)