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

Introduced by commit 0f31f7b.

Signed-off-by: Gao feng <gaofeng@cn.fujitsu.com>
Signed-off-by: Ján Tomko <jtomko@redhat.com>
This commit is contained in:
Gao feng 2013-10-29 14:19:35 +08:00 committed by Ján Tomko
parent 23142ac91a
commit 919374c73e

View File

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