mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +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:
@@ -1,5 +1,5 @@
|
||||
/* Netgroup file parser in nss_files modules.
|
||||
Copyright (C) 1996, 1997, 2000 Free Software Foundation, Inc.
|
||||
Copyright (C) 1996, 1997, 2000, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by Ulrich Drepper <drepper@cygnus.com>, 1996.
|
||||
|
||||
@@ -34,12 +34,14 @@
|
||||
do \
|
||||
{ \
|
||||
size_t old_cursor = result->cursor - result->data; \
|
||||
void *old_data = result->data; \
|
||||
\
|
||||
result->data_size += 512 > 2 * needed ? 512 : 2 * needed; \
|
||||
result->data = realloc (result->data, result->data_size); \
|
||||
\
|
||||
if (result->data == NULL) \
|
||||
{ \
|
||||
free (old_data); \
|
||||
status = NSS_STATUS_UNAVAIL; \
|
||||
goto the_end; \
|
||||
} \
|
||||
|
Reference in New Issue
Block a user