X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fmgetgroups.c;h=846662b7f4d70c278ea44b18f42728bbcb437eb3;hb=533101a268dc5015a140ff4695d8eeb04fbe57b6;hp=2d82f45cdc351122c4162a08b50645e5e627e949;hpb=d94bcb85e2e486d9ae424721cd8a6fd60553e6f6;p=gnulib.git diff --git a/lib/mgetgroups.c b/lib/mgetgroups.c index 2d82f45cd..846662b7f 100644 --- a/lib/mgetgroups.c +++ b/lib/mgetgroups.c @@ -133,7 +133,7 @@ mgetgroups (char const *username, gid_t gid, gid_t **groups) return -1; } - if (!username && gid != (gid_t) -1) + if (max_n_groups == 0 || (!username && gid != (gid_t) -1)) max_n_groups++; g = realloc_groupbuf (NULL, max_n_groups); if (g == NULL)