Skip to content

Commit

Permalink
Merge pull request #47 from gabrtv/fix-dangling-fd
Browse files Browse the repository at this point in the history
Defer tempfile close to avoid dangling FDs
  • Loading branch information
kelseyhightower committed Mar 18, 2014
2 parents fa6c096 + bf9747a commit 62be377
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions resource/template/resource.go
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ func (t *TemplateResource) createStageFile() error {
os.Remove(temp.Name())
return err
}
defer temp.Close()
log.Debug("Compiling source template " + t.Src)
tplFuncMap := make(template.FuncMap)
tplFuncMap["Base"] = path.Base
Expand Down

0 comments on commit 62be377

Please sign in to comment.