sklad: close the DB FD once finished reading

Fixes a resource leak.
This commit is contained in:
2020-10-10 14:18:22 +02:00
parent 696ea89530
commit 93b29a5346

View File

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