From 5592af2471650e3609be5a17af93c89209ad6ed1 Mon Sep 17 00:00:00 2001
From: guangwu <guoguangwu@magic-shield.com>
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 383869d002..73d9827ffe 100644
--- a/app/vmctl/main.go
+++ b/app/vmctl/main.go
@@ -282,6 +282,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 uint64
 					if err := stream.Parse(f, isBlockGzipped, func(block *stream.Block) error {
 						atomic.AddUint64(&blocksCount, 1)