From 229a2b3040a479ccc6052fe6d6c464fe301151c9 Mon Sep 17 00:00:00 2001 From: Thomas Bushnell Date: Sat, 30 Jan 1999 05:29:56 +0000 Subject: Sat Jan 30 00:27:14 1999 Thomas Bushnell, BSG * munge.c (create_queue): Make sure that malloc succeeds. Reported by OKUJI Yoshinori . --- term/munge.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'term/munge.c') 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; } -- cgit v1.2.3