sklad: close the DB FD once finished reading
Fixes a resource leak.
This commit is contained in:
parent
696ea89530
commit
93b29a5346
|
@ -298,6 +298,7 @@ func loadDatabase() error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
defer dbFile.Close()
|
||||||
if err := json.NewDecoder(dbFile).Decode(&db); err != nil {
|
if err := json.NewDecoder(dbFile).Decode(&db); err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue