From aa0c413814e8915b38d2285c6a8ba5bc3f0705b4 Mon Sep 17 00:00:00 2001 From: guoguangwu Date: Sat, 1 Jun 2024 14:58:20 +0800 Subject: [PATCH] fix: close testfile (#6830) Signed-off-by: guoguangwu --- pkg/fanal/test/integration/docker/docker.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/fanal/test/integration/docker/docker.go b/pkg/fanal/test/integration/docker/docker.go index 13ba250d4444..772aef0778f2 100644 --- a/pkg/fanal/test/integration/docker/docker.go +++ b/pkg/fanal/test/integration/docker/docker.go @@ -81,6 +81,7 @@ func (d Docker) ReplicateImage(ctx context.Context, imageRef, imagePath string, if err != nil { return err } + defer testfile.Close() // load image into docker engine resp, err := d.cli.ImageLoad(ctx, testfile, true)