From 1a88d49ee0f9c59a9c20db679f70ed96a59b803a Mon Sep 17 00:00:00 2001 From: guangwu Date: Wed, 22 May 2024 01:43:32 +0800 Subject: [PATCH] fix: close file (#7608) # Description _Please explain the changes you've made._ ## Type of change - This pull request fixes a bug in Radius and has an approved issue (issue link required). - This pull request adds or changes features of Radius and has an approved issue (issue link required). - This pull request is a minor refactor, code cleanup, test improvement, or other maintenance task and doesn't change the functionality of Radius (issue link optional). Fixes: #issue_number Signed-off-by: guoguangwu --- pkg/cli/tools/binary_tools.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/cli/tools/binary_tools.go b/pkg/cli/tools/binary_tools.go index 0aaef0c90a..bea69aaf73 100644 --- a/pkg/cli/tools/binary_tools.go +++ b/pkg/cli/tools/binary_tools.go @@ -166,6 +166,7 @@ func DownloadToFolder(filepath string) error { if err != nil { return fmt.Errorf("failed to open file %s: %v", filepath, err) } + defer bicepBinary.Close() // get the filemode so we can mark it as executable file, err := bicepBinary.Stat()