The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/2657

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From 0b84dd554b033c901b9fb0e357e6614ee3ebc631 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Sat, 26 Nov 2016 17:22:53 -0500
Subject: [PATCH] Cleanup leftover temp file
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxd/container_file.go | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lxd/container_file.go b/lxd/container_file.go
index e682061..7e9d20b 100644
--- a/lxd/container_file.go
+++ b/lxd/container_file.go
@@ -52,6 +52,7 @@ func containerFileGet(c container, path string, r 
*http.Request) Response {
        // Pull the file from the container
        uid, gid, mode, type_, dirEnts, err := c.FilePull(path, temp.Name())
        if err != nil {
+               os.Remove(temp.Name())
                return SmartError(err)
        }
 
@@ -71,8 +72,10 @@ func containerFileGet(c container, path string, r 
*http.Request) Response {
 
                return FileResponse(r, files, headers, true)
        } else if type_ == "directory" {
+               os.Remove(temp.Name())
                return SyncResponseHeaders(true, dirEnts, headers)
        } else {
+               os.Remove(temp.Name())
                return InternalError(fmt.Errorf("bad file type %s", type_))
        }
 }
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to