From 5caf4377f3a7fcb1f6e1a84c67136ae62d100be3 Mon Sep 17 00:00:00 2001 From: guangwu Date: Mon, 13 May 2024 10:45:19 +0800 Subject: [PATCH] fix: close APKINDEX archive file (#6672) 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)