sklad: close the DB FD once finished reading

Fixes a resource leak.
This commit is contained in:
Přemysl Eric Janouch 2020-10-10 14:18:22 +02:00
parent 696ea89530
commit 93b29a5346
Signed by: p
GPG Key ID: A0420B94F92B9493

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
}