Commit debfa8b6 by Serge Hallyn Committed by Stéphane Graber

cppcheck: fix unchecked realloc in lxc_info.c

parent ebd30892
......@@ -50,9 +50,13 @@ static int filter_count = 0;
static int my_parser(struct lxc_arguments* args, int c, char* arg)
{
char **newk;
switch (c) {
case 'c':
key = realloc(key, keys+1 * sizeof(key[0]));
newk = realloc(key, keys+1 * sizeof(key[0]));
if (!newk)
return -1;
key = newk;
key[keys] = arg;
keys++;
break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment