diff options
Diffstat (limited to 'pw/pw_user.c')
-rw-r--r-- | pw/pw_user.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pw/pw_user.c b/pw/pw_user.c index 76849ba..a71be12 100644 --- a/pw/pw_user.c +++ b/pw/pw_user.c @@ -1087,10 +1087,10 @@ split_groups(StringList **groups, char *groupsstr) char *p; char tok[] = ", \t"; + if (*groups == NULL) + *groups = sl_init(); for (p = strtok(groupsstr, tok); p != NULL; p = strtok(NULL, tok)) { grp = group_from_name_or_id(p); - if (*groups == NULL) - *groups = sl_init(); sl_add(*groups, newstr(grp->gr_name)); } } |