about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRoland McGrath <roland@gnu.org>2004-06-15 20:04:37 +0000
committerRoland McGrath <roland@gnu.org>2004-06-15 20:04:37 +0000
commit6d00189e10342ffa12aba5f4774f1dba7207ea04 (patch)
treef6cb444c76e06b3e07b1974f4bcc9a5d3c285308
parente1ad4c533af75b6ab84e789202aa25124bc44592 (diff)
downloadglibc-6d00189e10342ffa12aba5f4774f1dba7207ea04.tar.gz
glibc-6d00189e10342ffa12aba5f4774f1dba7207ea04.tar.xz
glibc-6d00189e10342ffa12aba5f4774f1dba7207ea04.zip
* stdio-common/psignal.c (psignal): Don't use BUF when asprintf
	failed.
-rw-r--r--ChangeLog5
-rw-r--r--stdio-common/psignal.c12
2 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index 4ff0520f3f..be5ec8def8 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-06-14  Andreas Schwab  <schwab@suse.de>
+
+	* stdio-common/psignal.c (psignal): Don't use BUF when asprintf
+	failed.
+
 2004-06-15  Steven Munroe  <sjmunroe@us.ibm.com>
 
 	* sysdeps/unix/sysv/linux/powerpc/powerpc32/getcontext.S: Fix pasto
diff --git a/stdio-common/psignal.c b/stdio-common/psignal.c
index 3a75224b78..2e6588c692 100644
--- a/stdio-common/psignal.c
+++ b/stdio-common/psignal.c
@@ -64,12 +64,14 @@ psignal (int sig, const char *s)
 	  else
 	    (void) fprintf (stderr, "%s%s%s\n", s, colon, _("Unknown signal"));
 	}
-
-      if (_IO_fwide (stderr, 0) > 0)
-	(void) __fwprintf (stderr, L"%s",  buf);
       else
-	(void) fputs (buf, stderr);
+	{
+	  if (_IO_fwide (stderr, 0) > 0)
+	    (void) __fwprintf (stderr, L"%s",  buf);
+	  else
+	    (void) fputs (buf, stderr);
 
-      free (buf);
+	  free (buf);
+	}
     }
 }