Skip to content

Commit

Permalink
fix rename failed when rewrite public keys (go-gitea#7761)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny committed Aug 6, 2019
1 parent 1b5908f commit cc7ba8a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion models/ssh_key.go
Original file line number Diff line number Diff line change
Expand Up @@ -642,12 +642,14 @@ func rewriteAllPublicKeys(e Engine) error {
}
_, err = t.WriteString(line + "\n")
if err != nil {
f.Close()
return err
}
}
defer f.Close()
f.Close()
}

t.Close()
return os.Rename(tmpPath, fPath)
}

Expand Down

0 comments on commit cc7ba8a

Please sign in to comment.