diff --git a/pkg/dependency/parser/java/pom/parse.go b/pkg/dependency/parser/java/pom/parse.go index a1b42b712e28..c4ee45c5024b 100644 --- a/pkg/dependency/parser/java/pom/parse.go +++ b/pkg/dependency/parser/java/pom/parse.go @@ -592,6 +592,7 @@ func (p *parser) openPom(filePath string) (*pom, error) { if err != nil { return nil, xerrors.Errorf("file open error (%s): %w", filePath, err) } + defer f.Close() content, err := parsePom(f) if err != nil {