From 93b29a534689cc171de0ca917c982d2f76496633 Mon Sep 17 00:00:00 2001 From: Přemysl Eric Janouch
Date: Sat, 10 Oct 2020 14:18:22 +0200 Subject: sklad: close the DB FD once finished reading Fixes a resource leak. --- cmd/sklad/db.go | 1 + 1 file changed, 1 insertion(+) (limited to 'cmd') diff --git a/cmd/sklad/db.go b/cmd/sklad/db.go index fc79f0f..3def2e5 100644 --- a/cmd/sklad/db.go +++ b/cmd/sklad/db.go @@ -298,6 +298,7 @@ func loadDatabase() error { if err != nil { return err } + defer dbFile.Close() if err := json.NewDecoder(dbFile).Decode(&db); err != nil { return err } -- cgit v1.2.3-70-g09d2