SIGN IN SIGN UP
hashicorp / terraform UNCLAIMED

Terraform enables you to safely and predictably create, change, and improve infrastructure. It is a source-available tool that codifies APIs into declarative configuration files that can be shared amongst team members, treated as code, edited, reviewed, and versioned.

0 0 33 Go

Fix resource leaks in provisioners and commands (#38585)

* Fix resource leaks in provisioners and commands

Close file handles, HTTP response bodies, and pipe ends that were
previously leaked on certain code paths:

- workspace_new.go: Close state file opened via os.Open
- file/resource_provisioner.go: Close temp file handle before returning
  the file path to caller
- login.go: Move defer resp.Body.Close() before ioutil.ReadAll so the
  body is closed even when ReadAll fails
- local-exec/resource_provisioner.go: Close the read end of os.Pipe
  after the copy goroutine completes

---------

Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
S
Sebastien Tardif committed
3c94ef65b3487839e5829d6c7d9342da7867cea0
Parent: 820f37b
Committed by GitHub <noreply@github.com> on 5/14/2026, 4:36:12 PM