[lxc-devel] [PATCH] Fix reallocation calculation
Serge Hallyn
serge.hallyn at ubuntu.com
Mon Sep 21 14:15:58 UTC 2015
Quoting Christian Brauner (christianvanbrauner at gmail.com):
> Signed-off-by: Christian Brauner <christianvanbrauner at gmail.com>
Acked-by: Serge E. Hallyn <serge.hallyn at ubuntu.com>
> ---
> src/lxc/lxc_info.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/lxc/lxc_info.c b/src/lxc/lxc_info.c
> index 9f1c469..58ff619 100644
> --- a/src/lxc/lxc_info.c
> +++ b/src/lxc/lxc_info.c
> @@ -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;
> --
> 2.5.3
>
> _______________________________________________
> lxc-devel mailing list
> lxc-devel at lists.linuxcontainers.org
> http://lists.linuxcontainers.org/listinfo/lxc-devel
More information about the lxc-devel
mailing list