Browse Source

Fix file leak in integration-cli

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
Qiang Huang 10 years ago
parent
commit
d28b0ba115
1 changed files with 1 additions and 0 deletions
  1. 1 0
      integration-cli/docker_utils.go

+ 1 - 0
integration-cli/docker_utils.go

@@ -1093,6 +1093,7 @@ func writeFile(dst, content string, c *check.C) {
 	if err != nil {
 		c.Fatal(err)
 	}
+	defer f.Close()
 	// Write content (truncate if it exists)
 	if _, err := io.Copy(f, strings.NewReader(content)); err != nil {
 		c.Fatal(err)