From: Wolfgang Bumiller Date: Thu, 28 Jul 2016 09:52:18 +0000 (+0200) Subject: conf: set pty_info to NULL after free X-Git-Tag: lxc-2.1.0~370^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e00c024230e457a0f37ea5c90bd8caac0c30020e;p=thirdparty%2Flxc.git conf: set pty_info to NULL after free 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 --- diff --git a/src/lxc/conf.c b/src/lxc/conf.c index 48a29787d..1e330ac9d 100644 --- a/src/lxc/conf.c +++ b/src/lxc/conf.c @@ -3327,6 +3327,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; }