app/vmctl: properly close file descriptor in verify-block action (#6106)

(cherry picked from commit 9dd5db2b77)
This commit is contained in:
guangwu 2024-04-16 17:33:04 +08:00 committed by hagen1778
parent 59fc201aee
commit c150924b81
No known key found for this signature in database
GPG key ID: 3BF75F3741CA9640

View file

@ -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)