From cbbc5fce741e4c09bccff60a8e24ad0b93c9451c Mon Sep 17 00:00:00 2001 From: Brian Norris Date: Mon, 12 Mar 2012 16:52:04 -0700 Subject: [PATCH] schedule: exit if we run out of linked-list nodes --- schedule.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/schedule.c b/schedule.c index c8f54e84..879ee14a 100644 --- a/schedule.c +++ b/schedule.c @@ -23,8 +23,10 @@ static void enqueue_thread(struct thread *t) struct thread_list_node *node; for (node = nodes, i = 0; node->live && i < NUM_LIST_NODES; i++, node++); - if (i >= NUM_LIST_NODES) + if (i >= NUM_LIST_NODES) { printf("ran out of nodes\n"); + exit(1); + } node->this = t; node->next = NULL; node->live = 1; -- 2.34.1