about summary refs log tree commit diff
path: root/resolv/res_hconf.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-05-07 03:57:57 +0000
committerUlrich Drepper <drepper@redhat.com>2004-05-07 03:57:57 +0000
commit9be31a514921c7415d61834ffa1387f24f631dfb (patch)
treee6d77813cd31858a49c7315b98510e3e3fc06c13 /resolv/res_hconf.c
parentf1debaf68214cb898f67355ee83169cc135e14e9 (diff)
downloadglibc-9be31a514921c7415d61834ffa1387f24f631dfb.tar.gz
glibc-9be31a514921c7415d61834ffa1387f24f631dfb.tar.xz
glibc-9be31a514921c7415d61834ffa1387f24f631dfb.zip
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.
Diffstat (limited to 'resolv/res_hconf.c')
-rw-r--r--resolv/res_hconf.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/resolv/res_hconf.c b/resolv/res_hconf.c
index cd622eddb8..59f186e246 100644
--- a/resolv/res_hconf.c
+++ b/resolv/res_hconf.c
@@ -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);