tty: Clean up completely if switching vt fails
The code under the "err" label closes the file descriptor and frees the allocated memory.
This commit is contained in:
parent
ef94085ff1
commit
acfb712127
@ -174,7 +174,7 @@ tty_create(struct weston_compositor *compositor, tty_vt_func_t vt_func,
|
|||||||
if (ioctl(tty->fd, VT_ACTIVATE, tty->vt) < 0 ||
|
if (ioctl(tty->fd, VT_ACTIVATE, tty->vt) < 0 ||
|
||||||
ioctl(tty->fd, VT_WAITACTIVE, tty->vt) < 0) {
|
ioctl(tty->fd, VT_WAITACTIVE, tty->vt) < 0) {
|
||||||
weston_log("failed to swtich to new vt\n");
|
weston_log("failed to swtich to new vt\n");
|
||||||
return NULL;
|
goto err;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user