mirror of
https://github.com/libvirt/libvirt.git
synced 2025-02-25 18:55:26 -06:00
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:
parent
23142ac91a
commit
919374c73e
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user