Close pubkey file after reading

This commit is contained in:
Mislav Marohnić 2021-02-17 17:01:14 +01:00
parent 87fcda5fbc
commit b4bf8cda8d

View file

@ -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