Commit 4e03ae57 by Dwight Engen Committed by Stéphane Graber

fix free() of args to startl

Coverity 1076328 marked this as "Use after free", which it isn't really, its actually just free()ing the wrong 2nd, 3rd, etc... pointers. Test by passing two or more args to startl, without this change you get segfault when free()ing the second pointer/arg. Signed-off-by: 's avatarDwight Engen <dwight.engen@oracle.com> Acked-by: 's avatarStéphane Graber <stgraber@ubuntu.com>
parent 9588a6ce
......@@ -641,9 +641,9 @@ static bool lxcapi_startl(struct lxc_container *c, int useinit, ...)
out:
if (inargs) {
char *arg;
for (arg = *inargs; arg; arg++)
free(arg);
char **arg;
for (arg = inargs; *arg; arg++)
free(*arg);
free(inargs);
}
......
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