From 919374c73e4efa185d4303281b2071f654cb052c Mon Sep 17 00:00:00 2001 From: Gao feng Date: Tue, 29 Oct 2013 14:19:35 +0800 Subject: [PATCH] LXC: don't free tty before using it in lxcContainerSetupDevices MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Introduced by commit 0f31f7b. Signed-off-by: Gao feng Signed-off-by: Ján Tomko --- src/lxc/lxc_container.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lxc/lxc_container.c b/src/lxc/lxc_container.c index 1ec59d5c6e..255c7114d2 100644 --- a/src/lxc/lxc_container.c +++ b/src/lxc/lxc_container.c @@ -1042,10 +1042,10 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths) if (virAsprintf(&tty, "/dev/tty%zu", i+1) < 0) return -1; if (symlink(ttyPaths[i], tty) < 0) { - VIR_FREE(tty); virReportSystemError(errno, _("Failed to symlink %s to %s"), ttyPaths[i], tty); + VIR_FREE(tty); return -1; } VIR_FREE(tty); -- 2.39.5