16151, 16153, 16167, 16172, 16195, 16214, 16245, 16271, 16274, 16283,
16289, 16293, 16314, 16316, 16330, 16337, 16338, 16356, 16365, 16366,
16369, 16372, 16375, 16379, 16384, 16385, 16386, 16387, 16390, 16394,
- 16400, 16407, 16408, 16414.
+ 16400, 16407, 16408, 16414, 16453.
* Slovenian translations for glibc messages have been contributed by the
Translation Project's Slovenian team of translators.
size_t buffilled = sizeof (*dataset);
char *buffer = NULL;
size_t nentries = 0;
- bool use_malloc = false;
size_t group_len = strlen (key) + 1;
union
{
}
memset (&data, '\0', sizeof (data));
- buffer = alloca (buflen);
+ buffer = xmalloc (buflen);
first_needed.elem.next = &first_needed.elem;
memcpy (first_needed.elem.name, key, group_len);
data.needed_groups = &first_needed.elem;
if (buflen - req->key_len - bufused < needed)
{
- size_t newsize = MAX (2 * buflen,
- buflen + 2 * needed);
- if (use_malloc || newsize > 1024 * 1024)
- {
- buflen = newsize;
- char *newbuf = xrealloc (use_malloc
- ? buffer
- : NULL,
- buflen);
-
- buffer = newbuf;
- use_malloc = true;
- }
- else
- extend_alloca (buffer, buflen, newsize);
+ buflen += MAX (buflen, 2 * needed);
+ buffer = xrealloc (buffer, buflen);
}
nhost = memcpy (buffer + bufused,
}
else if (status == NSS_STATUS_UNAVAIL && e == ERANGE)
{
- size_t newsize = 2 * buflen;
- if (use_malloc || newsize > 1024 * 1024)
- {
- buflen = newsize;
- char *newbuf = xrealloc (use_malloc
- ? buffer : NULL, buflen);
-
- buffer = newbuf;
- use_malloc = true;
- }
- else
- extend_alloca (buffer, buflen, newsize);
+ buflen *= 2;
+ buffer = xrealloc (buffer, buflen);
}
}
}
out:
- if (use_malloc)
- free (buffer);
+ free (buffer);
*resultp = dataset;