From b4bf8cda8dbcc991d69a6e56e4e513212b9ed412 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mislav=20Marohni=C4=87?= Date: Wed, 17 Feb 2021 17:01:14 +0100 Subject: [PATCH] Close pubkey file after reading --- pkg/cmd/auth/shared/ssh_keys.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cmd/auth/shared/ssh_keys.go b/pkg/cmd/auth/shared/ssh_keys.go index b4d3347a4..e5e6976a6 100644 --- a/pkg/cmd/auth/shared/ssh_keys.go +++ b/pkg/cmd/auth/shared/ssh_keys.go @@ -121,6 +121,7 @@ func sshKeyUpload(httpClient *http.Client, hostname, keyFile string) error { if err != nil { return err } + defer f.Close() keyBytes, err := ioutil.ReadAll(f) if err != nil { return err