fix(gost): close gost DB connection in server mode #1217 (#1221)

This commit is contained in:
Kota Kanbe
2021-04-21 11:59:11 +09:00
committed by GitHub
parent e7ca491a94
commit a692cec0ef
2 changed files with 11 additions and 0 deletions

View File

@@ -21,6 +21,7 @@ type DBDriver struct {
// Client is the interface of OVAL client.
type Client interface {
DetectUnfixed(*models.ScanResult, bool) (int, error)
CloseDB() error
}
// Base is a base struct
@@ -28,6 +29,10 @@ type Base struct {
DBDriver DBDriver
}
func (b Base) CloseDB() error {
return b.DBDriver.DB.CloseDB()
}
// FillCVEsWithRedHat fills CVE detailed with Red Hat Security
func FillCVEsWithRedHat(r *models.ScanResult, cnf config.GostConf) error {
db, locked, err := newGostDB(cnf)