From 3fcd05ae79088d9543e47a47020031e95c4cf2f9 Mon Sep 17 00:00:00 2001 From: Matthias <5011972+fasmat@users.noreply.github.com> Date: Wed, 20 Sep 2023 09:45:15 +0000 Subject: [PATCH] Add another missing close --- initialization/migrate_metadata.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/initialization/migrate_metadata.go b/initialization/migrate_metadata.go index c1540b420..db6907952 100644 --- a/initialization/migrate_metadata.go +++ b/initialization/migrate_metadata.go @@ -104,6 +104,10 @@ func migrateV0(dir string, logger *zap.Logger) (err error) { return fmt.Errorf("failed to determine metadata version: %w", err) } + if err := file.Close(); err != nil { + return fmt.Errorf("failed to close metadata file: %w", err) + } + if len(old.NodeId) != 32 { return fmt.Errorf("invalid node ID length: %d", len(old.NodeId)) }