about summary refs log tree commit diff
path: root/misc/error.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2004-04-20 18:58:56 +0000
committerUlrich Drepper <drepper@redhat.com>2004-04-20 18:58:56 +0000
commitf9a06dc1b5f83ddd6448c6bf80dfe9e02eb97a3d (patch)
tree0293530bb5e96f892765635e2a52c0ba5bd54d3b /misc/error.c
parentaf1ff65986677e1ee29b6adc2750163c64b5aaef (diff)
downloadglibc-f9a06dc1b5f83ddd6448c6bf80dfe9e02eb97a3d.tar.gz
glibc-f9a06dc1b5f83ddd6448c6bf80dfe9e02eb97a3d.tar.xz
glibc-f9a06dc1b5f83ddd6448c6bf80dfe9e02eb97a3d.zip
Update.
2004-04-20  Jakub Jelinek  <jakub@redhat.com>

	* sysdeps/unix/sysv/linux/shm_open.c (shm_unlink): Change EPERM into
	EACCES.

2004-04-20  Jakub Jelinek  <jakub@redhat.com>

	* stdio-common/vfscanf.c (_IO_vfscanf): Revert last %% whitespace
	handling change.
	* stdio-common/tst-sscanf.c (int_tests): Adjust.

	* nis/nss-nis.c: Include stdlib.h.

	* sysdeps/sparc/sparc32/dl-machine.h (elf_machine_rela): Shut up a
	warning.
	* sysdeps/sparc/sparc64/memcmp.S (memcmp): Remove BP_SYM () from
	libc_hidden_builtin_def.

2004-04-20  Jim Meyering  <jim@meyering.net>

	* misc/error.c (error_tail): Don't leak upon realloc failure.

2004-04-20  Martin Schwidefsky  <schwidefsky@de.ibm.com>

	* sysdeps/unix/sysv/linux/dl-execstack.c (_dl_make_stack_executable):
	Use RETURN_ADDRESS instead of __builtin_return_address.
Diffstat (limited to 'misc/error.c')
-rw-r--r--misc/error.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/misc/error.c b/misc/error.c
index de3b797a40..2501583366 100644
--- a/misc/error.c
+++ b/misc/error.c
@@ -1,5 +1,5 @@
 /* Error handler for noninteractive utilities
-   Copyright (C) 1990-1998, 2000-2002, 2003 Free Software Foundation, Inc.
+   Copyright (C) 1990-1998, 2000-2003, 2004 Free Software Foundation, Inc.
    This file is part of the GNU C Library.  Its master source is NOT part of
    the C library, however.  The master source lives in /gd/gnu/lib.
 
@@ -192,18 +192,19 @@ error_tail (int status, int errnum, const char *message, va_list args)
 	      if (wmessage != NULL && len / 2 < ALLOCA_LIMIT)
 		wmessage = NULL;
 
-	      wmessage = (wchar_t *) realloc (wmessage,
-					      len * sizeof (wchar_t));
-
-	      if (wmessage == NULL)
+	      wchar_t *p = (wchar_t *) realloc (wmessage,
+						len * sizeof (wchar_t));
+	      if (p == NULL)
 		{
+		  free (wmessage);
 		  fputws_unlocked (L"out of memory\n", stderr);
 		  return;
 		}
+	      wmessage = p;
 	    }
 
 	  memset (&st, '\0', sizeof (st));
-	  tmp =message;
+	  tmp = message;
 	}
       while ((res = mbsrtowcs (wmessage, &tmp, len, &st)) == len);