]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
use correct number of ttys during setup
authorSven Wegener <sven.wegener@stealer.net>
Thu, 26 Nov 2009 15:46:23 +0000 (16:46 +0100)
committerDaniel Lezcano <dlezcano@fr.ibm.com>
Thu, 26 Nov 2009 15:46:23 +0000 (16:46 +0100)
commit 985d15b106c8959ff130ba5425c2abbe36dc2cca "fix fdleak and errors
in lxc_create_tty()" created a zero-sized malloc(), causing memory
corruption. use config->tty like all the other code does.

Signed-off-by: Sven Wegener <sven.wegener@stealer.net>
Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com>
src/lxc/conf.c

index 0ce51aa6a7968c939c0c67e9ad292b85a3e2c06c..81bc470f6555c7bab5c4b3caea63f20d7c7553ce 100644 (file)
@@ -999,7 +999,7 @@ int lxc_create_tty(const char *name, struct lxc_conf *conf)
                return 0;
 
        tty_info->pty_info =
-               malloc(sizeof(*tty_info->pty_info)*tty_info->nbtty);
+               malloc(sizeof(*tty_info->pty_info)*conf->tty);
        if (!tty_info->pty_info) {
                SYSERROR("failed to allocate pty_info");
                return -1;