aboutsummaryrefslogtreecommitdiffstats
path: root/xmalloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'xmalloc.c')
-rw-r--r--xmalloc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/xmalloc.c b/xmalloc.c
index ed0b88e7..6d63cde8 100644
--- a/xmalloc.c
+++ b/xmalloc.c
@@ -28,7 +28,10 @@ xmalloc (int n)
p = (XMALLOCTYPE *) malloc(n);
if (p == (XMALLOCTYPE *) 0)
- error(PS_UNDEFINED, errno, _("malloc failed"));
+ {
+ report(stderr, errno, _("malloc failed"));
+ exit(PS_UNDEFINED);
+ }
return(p);
}
@@ -39,7 +42,10 @@ xrealloc (XMALLOCTYPE *p, int n)
return xmalloc (n);
p = (XMALLOCTYPE *) realloc(p, n);
if (p == (XMALLOCTYPE *) 0)
- error(PS_UNDEFINED, errno, _("realloc failed"));
+ {
+ report(stderr, errno, _("realloc failed"));
+ exit(PS_UNDEFINED);
+ }
return p;
}