mirror of
https://github.com/tailscale/tailscale.git
synced 2025-08-21 18:42:36 +00:00
all: fix more resource leaks found by staticmajor
Updates #5706 Signed-off-by: Emmanuel T Odeke <emmanuel@orijtech.com>
This commit is contained in:

committed by
Brad Fitzpatrick

parent
614a24763b
commit
680f8d9793
@@ -187,7 +187,12 @@ func buildWasm(dev bool) ([]byte, error) {
|
||||
return nil, fmt.Errorf("Cannot create main.wasm output file: %w", err)
|
||||
}
|
||||
outputPath := outputFile.Name()
|
||||
|
||||
defer os.Remove(outputPath)
|
||||
// Running defer (*os.File).Close() in defer order before os.Remove
|
||||
// because on some systems like Windows, it is possible for os.Remove
|
||||
// to fail for unclosed files.
|
||||
defer outputFile.Close()
|
||||
|
||||
args := []string{"build", "-tags", "tailscale_go,osusergo,netgo,nethttpomithttp2,omitidna,omitpemdecrypt"}
|
||||
if !dev {
|
||||
|
Reference in New Issue
Block a user