mirror of
https://sourceware.org/git/glibc.git
synced 2025-07-28 00:21:52 +03:00
Update.
* sysdeps/unix/sysv/linux/ifreq.c (__ifreq): Fix memory handling. * sysdeps/generic/ifreq.c (__ifreq): Fix memory handling. * resolv/res_hconf.c (_res_hconf_reorder_addrs): Make clear that realloc cannot fail. * nss/nss_files/files-netgrp.c (EXPAND): Free buffer which cannot be expanded. * nis/nis_table.c: Clean up memory handling. * nis/nis_subr.c (nis_getnames): Clean up memory handling. * nis/nis_removemember.c (nis_removemember): Add comment explaining use of realloc.
This commit is contained in:
@ -370,9 +370,13 @@ stringprep (char *in,
|
||||
free (ucs4);
|
||||
ucs4 = stringprep_utf8_to_ucs4 (in, -1, &ucs4len);
|
||||
maxucs4len = ucs4len + adducs4len;
|
||||
ucs4 = realloc (ucs4, maxucs4len * sizeof (uint32_t));
|
||||
if (!ucs4)
|
||||
return STRINGPREP_MALLOC_ERROR;
|
||||
uint32_t *newp = realloc (ucs4, maxucs4len * sizeof (uint32_t));
|
||||
if (!newp)
|
||||
{
|
||||
free (ucs4);
|
||||
return STRINGPREP_MALLOC_ERROR;
|
||||
}
|
||||
ucs4 = newp;
|
||||
|
||||
rc = stringprep_4i (ucs4, &ucs4len, maxucs4len, flags, profile);
|
||||
adducs4len += 50;
|
||||
|
Reference in New Issue
Block a user