1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Fix file leak in integration-cli

Signed-off-by: Qiang Huang <h.huangqiang@huawei.com>
This commit is contained in:
Qiang Huang 2015-07-09 18:52:18 +08:00
parent cab02a5bbc
commit d28b0ba115

View file

@ -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)