Skip to content

Commit

Permalink
Merge pull request #6371 from TheThingsNetwork/fix/rows-leak
Browse files Browse the repository at this point in the history
Close database information rows
  • Loading branch information
adriansmares authored Jul 4, 2023
2 parents 285bcc4 + fd9fce7 commit 568ba17
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions pkg/identityserver/bunstore/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ func newDB(ctx context.Context, db *bun.DB) (*baseDB, error) {
if err != nil {
return nil, storeutil.WrapDriverError(err)
}
defer res.Close()
res.Next()
if err = res.Scan(&version); err != nil {
return nil, storeutil.WrapDriverError(err)
Expand All @@ -58,6 +59,7 @@ func newDB(ctx context.Context, db *bun.DB) (*baseDB, error) {
if err != nil {
return nil, storeutil.WrapDriverError(err)
}
defer res.Close()
res.Next()
if err = res.Scan(&serverVersion); err != nil {
return nil, storeutil.WrapDriverError(err)
Expand Down

0 comments on commit 568ba17

Please sign in to comment.