Skip to content

Commit

Permalink
repair: add close of file
Browse files Browse the repository at this point in the history
Added close of file in createFileBackup function.
  • Loading branch information
better0fdead authored and LeonidVas committed Dec 11, 2023
1 parent 5dbd60d commit 889a1a7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions cli/repair/common.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ func createFileBackup(path string) (string, error) {
if err != nil {
return "", fmt.Errorf("Failed to open file: %s", err)
}
defer file.Close()

backupPath := getBackupPath(path)
backupFile, err := os.OpenFile(backupPath, os.O_CREATE|os.O_TRUNC|os.O_WRONLY, fileInfo.Mode())
Expand Down

0 comments on commit 889a1a7

Please sign in to comment.