]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
Fix reallocation calculation
authorChristian Brauner <christianvanbrauner@gmail.com>
Mon, 21 Sep 2015 07:53:43 +0000 (09:53 +0200)
committerStéphane Graber <stgraber@ubuntu.com>
Mon, 21 Sep 2015 15:36:49 +0000 (11:36 -0400)
Signed-off-by: Christian Brauner <christianvanbrauner@gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn@ubuntu.com>
src/lxc/lxc_info.c

index 9f1c469914789e239374f7940bc79845a95f3fe9..58ff619f2a0bf10d13573d5b6bb1135a438de71a 100644 (file)
@@ -53,7 +53,7 @@ static int my_parser(struct lxc_arguments* args, int c, char* arg)
        char **newk;
        switch (c) {
        case 'c':
-               newk = realloc(key, keys+1 * sizeof(key[0]));
+               newk = realloc(key, (keys + 1) * sizeof(key[0]));
                if (!newk)
                        return -1;
                key = newk;