From 2636c67478f3a15fb3b7126a245ada294205a3cf Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Sat, 11 May 2024 17:11:23 +0800 Subject: [PATCH] fix: close APKINDEX archive file Signed-off-by: guoguangwu --- pkg/fanal/analyzer/imgconf/apk/apk.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/fanal/analyzer/imgconf/apk/apk.go b/pkg/fanal/analyzer/imgconf/apk/apk.go index 43f6cc278023..430dc766d161 100644 --- a/pkg/fanal/analyzer/imgconf/apk/apk.go +++ b/pkg/fanal/analyzer/imgconf/apk/apk.go @@ -103,6 +103,7 @@ func (a alpineCmdAnalyzer) fetchApkIndexArchive(targetOS types.OS) (*apkIndex, e if err != nil { return nil, xerrors.Errorf("failed to read APKINDEX archive file: %w", err) } + defer reader.(*builtinos.File).Close() } else { // nolint resp, err := http.Get(url)