Index: lib/system_smbd.c =================================================================== --- lib/system_smbd.c (revision 395) +++ lib/system_smbd.c (working copy) @@ -88,6 +88,10 @@ groups[0] = gid; *grpcnt = ret + 1; } + + /* remove any duplicates gids in the list */ + + remove_duplicate_gids( grpcnt, groups ); } restore_re_gid(); @@ -100,11 +104,6 @@ return -1; } - /* this will remove any duplicates gids in the list and - update the group counter */ - - remove_duplicate_gids( grpcnt, groups ); - free(gids_saved); return ret; }