From 54b3b4b7e92fe237942a78c374ca2d57465719b9 Mon Sep 17 00:00:00 2001 From: Matthias Andree Date: Thu, 29 Apr 2010 20:38:17 +0200 Subject: On xmalloc/xrealloc failures, abort() rather than exit(PS_UNDEFINED). --- NEWS | 2 ++ xmalloc.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index 7a7823b5..9dddf135 100644 --- a/NEWS +++ b/NEWS @@ -89,6 +89,8 @@ fetchmail-6.3.17 (not yet released): local issuer certificate" and self-signed certificates -- these usually hint to missing root signing CAs in the certs directory. * Several fixes for compiler (GCC, Intel C++, CLang) and autotools warnings +* Memory allocation failures will now cause abnormal program abort (SIGABRT), + not exit with unspecified code. # DOCUMENTATION * Fix table of global option to read "set softbounce" where there used to be a diff --git a/xmalloc.c b/xmalloc.c index f722c73b..c2ca4a66 100644 --- a/xmalloc.c +++ b/xmalloc.c @@ -31,7 +31,7 @@ xmalloc (size_t n) if (p == (XMALLOCTYPE *) 0) { report(stderr, GT_("malloc failed\n")); - exit(PS_UNDEFINED); + abort(); } return(p); } @@ -45,7 +45,7 @@ xrealloc (XMALLOCTYPE *p, size_t n) if (p == (XMALLOCTYPE *) 0) { report(stderr, GT_("realloc failed\n")); - exit(PS_UNDEFINED); + abort(); } return p; } -- cgit v1.2.3