Skip to content

Commit

Permalink
close statement when missing query arguments
Browse files Browse the repository at this point in the history
fixes #1280
  • Loading branch information
mattn committed Oct 4, 2024
1 parent 846fea6 commit 6cc847b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions sqlite3.go
Original file line number Diff line number Diff line change
Expand Up @@ -929,6 +929,7 @@ func (c *SQLiteConn) query(ctx context.Context, query string, args []driver.Name
s.(*SQLiteStmt).cls = true
na := s.NumInput()
if len(args)-start < na {
s.Close()
return nil, fmt.Errorf("not enough args to execute query: want %d got %d", na, len(args)-start)
}
// consume the number of arguments used in the current
Expand Down

0 comments on commit 6cc847b

Please sign in to comment.