Commit d791668b by Serge Hallyn

lxc_user_nic: free_groupnames: fix

lxc_user_nic was segfaulting: lxc-user-nic[9761]: segfault at 29 ip 00007f3fb2346872 sp 00007ffdd17b2dd0 error 4 in libc-2.21.so[7f3fb22c2000+1c0000 This patch fixes it. Signed-off-by: 's avatarSerge Hallyn <serge.hallyn@ubuntu.com>
parent 2c7a5008
...@@ -99,9 +99,11 @@ static char *get_username(void) ...@@ -99,9 +99,11 @@ static char *get_username(void)
static void free_groupnames(char **groupnames) static void free_groupnames(char **groupnames)
{ {
char **group; int i;
for (group=groupnames; group != NULL; group++) if (!groupnames)
free(*group); return;
for (i = 0; groupnames[i]; i++)
free(groupnames[i]);
free(groupnames); free(groupnames);
} }
......
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