]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
start: delete terminal on error
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 30 Jun 2018 11:03:33 +0000 (13:03 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sun, 1 Jul 2018 18:00:15 +0000 (20:00 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/start.c

index 9f5f50d53881d8d2a800d355889df00c73ee330e..a0bcd80bbfb31d785b356ee99d77dae577ba6446 100644 (file)
@@ -842,20 +842,22 @@ int lxc_init(const char *name, struct lxc_handler *handler)
        ret = lxc_terminal_map_ids(conf, &conf->console);
        if (ret < 0) {
                ERROR("Failed to chown console");
-               goto out_restore_sigmask;
+               goto out_delete_terminal;
        }
        TRACE("Chowned console");
 
        handler->cgroup_ops = cgroup_init(handler);
        if (!handler->cgroup_ops) {
                ERROR("Failed to initialize cgroup driver");
-               goto out_restore_sigmask;
+               goto out_delete_terminal;
        }
        TRACE("Initialized cgroup driver");
 
        INFO("Container \"%s\" is initialized", name);
        return 0;
 
+out_delete_terminal:
+       lxc_terminal_delete(&handler->conf->console);
 out_restore_sigmask:
        (void)pthread_sigmask(SIG_SETMASK, &handler->oldmask, NULL);
 out_delete_tty: