From 8f0e366ea7a529abc1958a2b5e3a6407f4acbb89 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)) }