[lxc-devel] [PATCH] Fix reallocation calculation

Christian Brauner christianvanbrauner at gmail.com
Mon Sep 21 07:53:43 UTC 2015


Signed-off-by: Christian Brauner <christianvanbrauner at gmail.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



More information about the lxc-devel mailing list