Skip to content

Commit

Permalink
Make sure /etc/mender/scripts/version is closed after use.
Browse files Browse the repository at this point in the history
Changelog: Fix a (possible) file descriptor leak.

Signed-off-by: Kristian Amlie <kristian.amlie@northern.tech>
  • Loading branch information
kacf committed Jan 10, 2022
1 parent b39db61 commit 19c34f3
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions statescript/executor.go
Expand Up @@ -121,6 +121,7 @@ func (l Launcher) CheckRootfsScriptsVersion() error {
} else if err != nil {
return errors.Wrap(err, "statescript")
}
defer f.Close()
ver, err := readVersion(f)
if _, ok := err.(readVersionParseError); ok {
errmsg := "statescript: Failed to parse the version file in the statescript" +
Expand Down

0 comments on commit 19c34f3

Please sign in to comment.