summaryrefslogtreecommitdiff
path: root/nalloc.c
diff options
context:
space:
mode:
authortjg <tjg>2002-08-20 15:38:52 +0000
committerToby Goodwin <toby@paccrat.org>2015-05-16 21:23:23 +0100
commitabc309bee6007ed47a2aee33705324dc9cc8050a (patch)
tree5a2f33ac9af26e52c2b2dd86d17151476e04d242 /nalloc.c
parent456bce4845a7035515a737e3276e5390c2b6db16 (diff)
Bug: don't call ealloc(0) on systems where getgroups() doesn't
return egid (thanks Chris Siebenmann).
Diffstat (limited to 'nalloc.c')
-rw-r--r--nalloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/nalloc.c b/nalloc.c
index eb621e0..0144b48 100644
--- a/nalloc.c
+++ b/nalloc.c
@@ -112,8 +112,10 @@ extern void restoreblock(Block *old) {
/* generic memory allocation functions */
extern void *ealloc(size_t n) {
- void *p = malloc(n);
+ void *p;
+ assert(n);
+ p = malloc(n);
if (p == NULL) {
uerror("malloc");
rc_exit(1);