summaryrefslogtreecommitdiff
path: root/term/munge.c
diff options
context:
space:
mode:
authorThomas Bushnell <thomas@gnu.org>1999-01-30 05:29:56 +0000
committerThomas Bushnell <thomas@gnu.org>1999-01-30 05:29:56 +0000
commit229a2b3040a479ccc6052fe6d6c464fe301151c9 (patch)
treee58567a4216d98148785610e4264084575934566 /term/munge.c
parent9a6d074200ca9eb2f2f4a4fdb804f33ecef5da17 (diff)
Sat Jan 30 00:27:14 1999 Thomas Bushnell, BSG <tb@mit.edu>
* munge.c (create_queue): Make sure that malloc succeeds. Reported by OKUJI Yoshinori <okuji@kuicr.kyoto-u.ac.jp>.
Diffstat (limited to 'term/munge.c')
-rw-r--r--term/munge.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/term/munge.c b/term/munge.c
index 653d32ba..f9cb5d72 100644
--- a/term/munge.c
+++ b/term/munge.c
@@ -1,5 +1,5 @@
/*
- Copyright (C) 1995, 1996 Free Software Foundation, Inc.
+ Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc.
Written by Michael I. Bushnell, p/BSG.
This file is part of the GNU Hurd.
@@ -713,12 +713,16 @@ create_queue (int size, int lowat, int hiwat)
struct queue *q;
q = malloc (sizeof (struct queue) + size * sizeof (quoted_char));
+ assert (q);
+
q->susp = 0;
q->lowat = lowat;
q->hiwat = hiwat;
q->cs = q->ce = q->array;
q->arraylen = size;
q->wait = malloc (sizeof (struct condition));
+ assert (q->wait);
+
condition_init (q->wait);
return q;
}