From 9dd5db2b77c78781c9d383acbec25489cb5abfc8 Mon Sep 17 00:00:00 2001 From: guangwu Date: Tue, 16 Apr 2024 17:33:04 +0800 Subject: [PATCH] app/vmctl: properly close file descriptor in `verify-block` action (#6106) --- app/vmctl/main.go | 1 + 1 file changed, 1 insertion(+) diff --git a/app/vmctl/main.go b/app/vmctl/main.go index ee2678073..10ca56d35 100644 --- a/app/vmctl/main.go +++ b/app/vmctl/main.go @@ -372,6 +372,7 @@ func main() { if err != nil { return cli.Exit(fmt.Errorf("cannot open exported block at path=%q err=%w", blockPath, err), 1) } + defer f.Close() var blocksCount atomic.Uint64 if err := stream.Parse(f, isBlockGzipped, func(_ *stream.Block) error { blocksCount.Add(1)