Compare commits

...

2 Commits

Author SHA1 Message Date
Přemysl Eric Janouch 6fc00ba3dd
Name change 2020-10-10 14:19:35 +02:00
Přemysl Eric Janouch 93b29a5346
sklad: close the DB FD once finished reading
Fixes a resource leak.
2020-10-10 14:18:22 +02:00
2 changed files with 2 additions and 1 deletions

View File

@ -1,4 +1,4 @@
Copyright (c) 2019, Přemysl Janouch <p@janouch.name>
Copyright (c) 2019, Přemysl Eric Janouch <p@janouch.name>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.

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
}