]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
conf: set pty_info to NULL after free
authorWolfgang Bumiller <w.bumiller@proxmox.com>
Thu, 28 Jul 2016 09:52:18 +0000 (11:52 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Thu, 17 Nov 2016 23:27:55 +0000 (18:27 -0500)
This fixes a double free corruption on container-requested
reboots when lxc_spawn() fails before receiving the ttys, as
lxc_fini() (part of __lxc_start()'s cleanup) calls
lxc_delete_tty().

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
src/lxc/conf.c

index 4e36bcb14307e08f6825147b958e22cf76f47dc6..076360109c87ed2552db838b93db04665b224acd 100644 (file)
@@ -3840,6 +3840,7 @@ void lxc_delete_tty(struct lxc_tty_info *tty_info)
        }
 
        free(tty_info->pty_info);
+       tty_info->pty_info = NULL;
        tty_info->nbtty = 0;
 }