Skip to content

Commit b4bf8cd

Browse files
committed
Close pubkey file after reading
1 parent 87fcda5 commit b4bf8cd

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

pkg/cmd/auth/shared/ssh_keys.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ func sshKeyUpload(httpClient *http.Client, hostname, keyFile string) error {
121121
if err != nil {
122122
return err
123123
}
124+
defer f.Close()
124125
keyBytes, err := ioutil.ReadAll(f)
125126
if err != nil {
126127
return err

0 commit comments

Comments
 (0)