View | Details | Raw Unified | Return to bug 11901
Collapse All | Expand All

(-)a/sysdeps/posix/libc_fatal.c (-5 / +2 lines)
Lines 125-131 __libc_message (int do_abort, const char *fmt, ...) Link Here
125
      if (TEMP_FAILURE_RETRY (__writev (fd, iov, nlist)) == total)
125
      if (TEMP_FAILURE_RETRY (__writev (fd, iov, nlist)) == total)
126
	written = true;
126
	written = true;
127
127
128
      char *buf = do_abort ? malloc (total + 1) : NULL;
128
      char *buf = do_abort ? sbrk (total + 1) : NULL;
129
      if (buf != NULL)
129
      if (buf != NULL)
130
	{
130
	{
131
	  char *wp = buf;
131
	  char *wp = buf;
Lines 133-142 __libc_message (int do_abort, const char *fmt, ...) Link Here
133
	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
133
	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
134
	  *wp = '\0';
134
	  *wp = '\0';
135
135
136
	  /* We have to free the old buffer since the application might
136
	  atomic_exchange_acq (&__abort_msg, buf);
137
	     catch the SIGABRT signal.  */
138
	  char *old = atomic_exchange_acq (&__abort_msg, buf);
139
	  free (old);
140
	}
137
	}
141
    }
138
    }
142
139
(-)a/sysdeps/unix/sysv/linux/libc_fatal.c (-5 / +2 lines)
Lines 134-140 __libc_message (int do_abort, const char *fmt, ...) Link Here
134
      if (cnt == total)
134
      if (cnt == total)
135
	written = true;
135
	written = true;
136
136
137
      char *buf = do_abort ? malloc (total + 1) : NULL;
137
      char *buf = do_abort ? sbrk (total + 1) : NULL;
138
      if (buf != NULL)
138
      if (buf != NULL)
139
	{
139
	{
140
	  char *wp = buf;
140
	  char *wp = buf;
Lines 142-151 __libc_message (int do_abort, const char *fmt, ...) Link Here
142
	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
142
	    wp = mempcpy (wp, iov[cnt].iov_base, iov[cnt].iov_len);
143
	  *wp = '\0';
143
	  *wp = '\0';
144
144
145
	  /* We have to free the old buffer since the application might
145
	  atomic_exchange_acq (&__abort_msg, buf);
146
	     catch the SIGABRT signal.  */
147
	  char *old = atomic_exchange_acq (&__abort_msg, buf);
148
	  free (old);
149
	}
146
	}
150
    }
147
    }
151
148

Return to bug 11901