summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2012-12-05 18:47:08 +0000
committerKristian Høgsberg <krh@bitplanet.net>2012-12-11 23:47:23 -0500
commitb28d8edb657b37e8a33ef40f261035e27838c9f1 (patch)
tree6ef9174a02260b04e3e43a474d0c42cc58644c45
parent8104ec5dd55071ad30669592f91fe2efc134447d (diff)
downloadweston-b28d8edb657b37e8a33ef40f261035e27838c9f1.tar.gz
tty: Clean up completely if switching vt fails
The code under the "err" label closes the file descriptor and frees the allocated memory.
-rw-r--r--src/tty.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tty.c b/src/tty.c
index 6d58aa5c..05e5e20f 100644
--- a/src/tty.c
+++ b/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;
}
}