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: Dwight Engen <dwight.engen@oracle.com>
Acked-by: Stéphane Graber <stgraber@ubuntu.com>
out:
if (inargs) {
- char *arg;
- for (arg = *inargs; arg; arg++)
- free(arg);
+ char **arg;
+ for (arg = inargs; *arg; arg++)
+ free(*arg);
free(inargs);
}