From 82bc911e85b3def2940e41767480745bcbb6ef45 Mon Sep 17 00:00:00 2001 From: Yasuhiro Matsumoto Date: Fri, 4 Oct 2024 23:52:25 +0900 Subject: [PATCH] close statement when missing query arguments fixes #1280 --- sqlite3.go | 1 + 1 file changed, 1 insertion(+) diff --git a/sqlite3.go b/sqlite3.go index ed2a9e2a..ce985ec8 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -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