提交 919374c7 编写于 作者: G Gao feng 提交者: Ján Tomko

LXC: don't free tty before using it in lxcContainerSetupDevices

Introduced by commit 0f31f7b7.
Signed-off-by: NGao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: NJán Tomko <jtomko@redhat.com>
上级 23142ac9
...@@ -1042,10 +1042,10 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths) ...@@ -1042,10 +1042,10 @@ static int lxcContainerSetupDevices(char **ttyPaths, size_t nttyPaths)
if (virAsprintf(&tty, "/dev/tty%zu", i+1) < 0) if (virAsprintf(&tty, "/dev/tty%zu", i+1) < 0)
return -1; return -1;
if (symlink(ttyPaths[i], tty) < 0) { if (symlink(ttyPaths[i], tty) < 0) {
VIR_FREE(tty);
virReportSystemError(errno, virReportSystemError(errno,
_("Failed to symlink %s to %s"), _("Failed to symlink %s to %s"),
ttyPaths[i], tty); ttyPaths[i], tty);
VIR_FREE(tty);
return -1; return -1;
} }
VIR_FREE(tty); VIR_FREE(tty);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册