Skip to content

Commit

Permalink
fix: close sql driver after testing sqlite availability
Browse files Browse the repository at this point in the history
  • Loading branch information
ttc0419 committed Jun 3, 2024
1 parent 3ac95bf commit ff4e9b3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions syft/pkg/cataloger/redhat/cataloger.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ func NewArchiveCataloger() pkg.Cataloger {
}

func isSqliteDriverAvailable() bool {
_, err := sql.Open("sqlite", ":memory:")
return err == nil
db, err := sql.Open("sqlite", ":memory:")
if err != nil {
return false
}
_ = db.Close()
return true
}

0 comments on commit ff4e9b3

Please sign in to comment.