From 63b545787ee7f5d4158351c950ac4a0ac1eff886 Mon Sep 17 00:00:00 2001 From: Frederik Ring Date: Thu, 1 Feb 2024 18:14:18 +0100 Subject: [PATCH] Exclusive file lock is released prematurely (#339) --- cmd/backup/main.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/backup/main.go b/cmd/backup/main.go index b61c157..12db052 100644 --- a/cmd/backup/main.go +++ b/cmd/backup/main.go @@ -15,7 +15,9 @@ func main() { } unlock, err := s.lock("/var/lock/dockervolumebackup.lock") - defer s.must(unlock()) + defer func() { + s.must(unlock()) + }() s.must(err) defer func() {