*size *= 2;
*size = newsize;
_nss_nis_initgroups_dyn (const char *user, gid_t group, long int *start,			 long int *size, gid_t **groupsp, int *errnop){  struct group grpbuf, *g;  size_t buflen = sysconf (_SC_GETPW_R_SIZE_MAX);  char *tmpbuf;  enum nss_status status;  intern_t intern = { NULL, NULL };  gid_t *groups = *groupsp;  status = internal_setgrent (&intern);  if (status != NSS_STATUS_SUCCESS)    return status;  tmpbuf = __alloca (buflen);  do    {      while ((status =	      internal_getgrent_r (&grpbuf, tmpbuf, buflen, errnop,				   &intern)) == NSS_STATUS_TRYAGAIN             && *errnop == ERANGE)        {          buflen *= 2;          tmpbuf = __alloca (buflen);        }      if (status != NSS_STATUS_SUCCESS)	goto done;      g = &grpbuf;      if (g->gr_gid != group)        {          char **m;          for (m = g->gr_mem; *m != NULL; ++m)            if (strcmp (*m, user) == 0)              {                /* Matches user.  Insert this group.  */                if (*start == *size)                  {                    /* Need a bigger buffer.  */		    gid_t *newgroups;		    newgroups = realloc (groups, 2 * *size * sizeof (*groups));		    if (newgroups == NULL)		      goto done;		    *groupsp = groups = newgroups;                    *size *= 2;                  }                groups[*start] = g->gr_gid;		*start += 1;                break;              }        }    }  while (status == NSS_STATUS_SUCCESS);done:  while (intern.start != NULL)    {      if (intern.start->val != NULL)        free (intern.start->val);      intern.next = intern.start;      intern.start = intern.start->next;      free (intern.next);    }  return NSS_STATUS_SUCCESS;}