Skip to content

Commit

Permalink
fix: close the file fd when it indeed (istio#46874)
Browse files Browse the repository at this point in the history
Signed-off-by: wwwnay <ywilling@outlook.com>
  • Loading branch information
wwwnay authored Sep 7, 2023
1 parent b4b2fb4 commit ab9a140
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/test/util/yml/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ func writeContentsToTempFile(workDir, contents string) (filename string, err err
if err != nil {
return
}
defer f.Close()
filename = f.Name()

_, err = f.WriteString(contents)
Expand Down

0 comments on commit ab9a140

Please sign in to comment.