From 9150577da1c9f720200aac4e1474d8e628da6239 Mon Sep 17 00:00:00 2001 From: mattn Date: Mon, 9 Sep 2013 11:26:55 +0900 Subject: [PATCH] Close rows if not nil --- sqlite3.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sqlite3.go b/sqlite3.go index daa3220..6598e02 100644 --- a/sqlite3.go +++ b/sqlite3.go @@ -175,7 +175,9 @@ func (c *SQLiteConn) Query(query string, args []driver.Value) (driver.Rows, erro if s.t == "" { return rows, nil } - rows.Close() + if rows != nil { + rows.Close() + } s.Close() query = s.t }