all: fix resource leaks with missing .Close() calls

Fixes #5706

Signed-off-by: Emmanuel T Odeke <emmanuel@orijtech.com>
This commit is contained in:
Emmanuel T Odeke
2022-09-20 21:27:47 -07:00
committed by Brad Fitzpatrick
parent 9bdf0cd8cd
commit f981b1d9da
5 changed files with 21 additions and 3 deletions

View File

@@ -48,7 +48,7 @@ func runConfigureHost(ctx context.Context, args []string) error {
if uid := os.Getuid(); uid != 0 {
return fmt.Errorf("must be run as root, not %q (%v)", os.Getenv("USER"), uid)
}
hi:= hostinfo.New()
hi := hostinfo.New()
isDSM6 := strings.HasPrefix(hi.DistroVersion, "6.")
isDSM7 := strings.HasPrefix(hi.DistroVersion, "7.")
if !isDSM6 && !isDSM7 {