tty: Clean up completely if switching vt fails

The code under the "err" label closes the file descriptor and frees the
allocated memory.
Rob Bradford 12 years ago committed by Kristian Høgsberg
parent ef94085ff1
commit acfb712127
  1. 2
      src/tty.c

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

Loading…
Cancel
Save