From d28b0ba115f44f7a49cfc442d5eff146e57c3167 Mon Sep 17 00:00:00 2001 From: Qiang Huang Date: Thu, 9 Jul 2015 18:52:18 +0800 Subject: [PATCH] Fix file leak in integration-cli Signed-off-by: Qiang Huang --- integration-cli/docker_utils.go | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-cli/docker_utils.go b/integration-cli/docker_utils.go index c6662a84b8..964ef2d4d9 100644 --- a/integration-cli/docker_utils.go +++ b/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)