summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-11-21 10:48:43 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-11-21 10:48:43 +0200
commitd00161ea2a57bcc45a34a35fed0d46c0e3b2de99 (patch)
tree76b2d054e9e72259679740a50000b7fbbeef3d51
parentf3eec73c3b99d1b688421ca2c3e0cd3117ca452d (diff)
parentf49b0b03937c6edfdfba5cfc229557dcfe56b2c7 (diff)
downloadgawk-d00161ea2a57bcc45a34a35fed0d46c0e3b2de99.tar.gz
Merge branch 'gawk-4.1-stable' into memory-work
-rw-r--r--ChangeLog5
-rw-r--r--gawkmisc.c5
-rw-r--r--xalloc.h2
3 files changed, 8 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index a053ca66..2162c9c0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,11 @@
* main.c: Remove a debugging // comment.
* NOTES: Removed.
+ Unrelated:
+
+ Revert changes of 2014-11-20 from Paul Eggert. Causes failures
+ on z/OS.
+
2014-11-20 Paul Eggert <eggert@cs.ucla.edu>
Port to systems where malloc (0) and/or realloc(P, 0) returns NULL.
diff --git a/gawkmisc.c b/gawkmisc.c
index fff5cc56..a729d88d 100644
--- a/gawkmisc.c
+++ b/gawkmisc.c
@@ -51,8 +51,7 @@ extern pointer xmalloc(size_t bytes); /* get rid of gcc warning */
pointer
xmalloc(size_t bytes)
{
- pointer p = malloc(bytes);
- if (!p && bytes)
- xalloc_die ();
+ pointer p;
+ emalloc(p, pointer, bytes, "xmalloc");
return p;
}
diff --git a/xalloc.h b/xalloc.h
index 5ee45164..0d169cf9 100644
--- a/xalloc.h
+++ b/xalloc.h
@@ -156,7 +156,7 @@ void *
xrealloc(void *p, size_t size)
{
void *new_p = realloc(p, size);
- if (!new_p && size)
+ if (new_p == 0)
xalloc_die ();
return new_p;