mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-08 17:42:12 +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,4 +1,4 @@
|
||||
/* Copyright (C) 1993, 1995-2001, 2002, 2003 Free Software Foundation, Inc.
|
||||
/* Copyright (C) 1993, 1995-2003, 2004 Free Software Foundation, Inc.
|
||||
This file is part of the GNU C Library.
|
||||
Contributed by David Mosberger (davidm@azstarnet.com).
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
a line)
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <errno.h>
|
||||
#include <ctype.h>
|
||||
#include <libintl.h>
|
||||
@@ -577,6 +578,7 @@ _res_hconf_reorder_addrs (struct hostent *hp)
|
||||
}
|
||||
/* Just keep enough memory to hold all the interfaces we want. */
|
||||
ifaddrs = realloc (ifaddrs, num_ifs * sizeof (ifaddrs[0]));
|
||||
assert (ifaddrs != NULL);
|
||||
|
||||
cleanup1:
|
||||
__if_freereq (ifr, num);
|
||||
|
Reference in New Issue
Block a user