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

@@ -369,6 +369,12 @@ func detectPkgsCvesWithGost(cnf config.GostConf, r *models.ScanResult) error {
return xerrors.Errorf("Failed to new a gost client: %w", err)
}
defer func() {
if err := client.CloseDB(); err != nil {
logging.Log.Errorf("Failed to close the gost DB. err: %+v", err)
}
}()
nCVEs, err := client.DetectUnfixed(r, true)
if err != nil {
return xerrors.Errorf("Failed to detect unfixed CVEs with gost: %w", err)