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:
Rob Bradford 2012-12-05 18:47:08 +00:00 committed by Kristian Høgsberg
parent ef94085ff1
commit acfb712127

View File

@ -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 ||
ioctl(tty->fd, VT_WAITACTIVE, tty->vt) < 0) {
weston_log("failed to swtich to new vt\n");
return NULL;
goto err;
}
}