mirror of
https://github.com/anchore/grype
synced 2024-11-10 06:34:13 +00:00
fix: correctly close the db file in v4/v5 stores (#2066)
Signed-off-by: Andrei Stefanie <andrei.stefanie@gmail.com>
This commit is contained in:
parent
7dfa436314
commit
589d86c35a
2 changed files with 4 additions and 4 deletions
|
@ -265,8 +265,8 @@ func (s *store) AddVulnerabilityMatchExclusion(exclusions ...v4.VulnerabilityMat
|
|||
func (s *store) Close() {
|
||||
s.db.Exec("VACUUM;")
|
||||
|
||||
sqlDB, err := s.db.DB()
|
||||
if err != nil {
|
||||
sqlDB, _ := s.db.DB()
|
||||
if sqlDB != nil {
|
||||
_ = sqlDB.Close()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -289,8 +289,8 @@ func (s *store) AddVulnerabilityMatchExclusion(exclusions ...v5.VulnerabilityMat
|
|||
func (s *store) Close() {
|
||||
s.db.Exec("VACUUM;")
|
||||
|
||||
sqlDB, err := s.db.DB()
|
||||
if err != nil {
|
||||
sqlDB, _ := s.db.DB()
|
||||
if sqlDB != nil {
|
||||
_ = sqlDB.Close()
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue