Skip to content

Commit 20339d3

Browse files
Fix resource leak: close staging Rows in execStagingOperation
execStagingOperation creates a Rows object via rows.NewRows() to read staging operation metadata but never closes it. This leaks the Rows object and its RowScanner resources until GC collects them. Add defer row.Close() to ensure proper cleanup. Related: #275 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1 parent cd6dc19 commit 20339d3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

connection.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -592,6 +592,7 @@ func (c *conn) execStagingOperation(
592592
if err != nil {
593593
return dbsqlerrint.NewDriverError(ctx, "error reading row.", err)
594594
}
595+
defer row.Close()
595596

596597
} else {
597598
return dbsqlerrint.NewDriverError(ctx, "staging ctx must be provided.", nil)

0 commit comments

Comments
 (0)