From 5cfc88a71854ef17a4a0f3c761d2718fac827329 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Tue, 3 Dec 2002 20:06:21 +0000 Subject: (get_cached_stack): Don't crash if we first found a stack with a larger size then needed. --- nptl/allocatestack.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'nptl/allocatestack.c') diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c index e9e1cfd1cd..9f12f2b940 100644 --- a/nptl/allocatestack.c +++ b/nptl/allocatestack.c @@ -114,7 +114,8 @@ get_cached_stack (size_t *sizep, void **memp) break; } - if (result->stackblock_size > curr->stackblock_size) + if (result == NULL + || result->stackblock_size > curr->stackblock_size) result = curr; } } -- cgit v1.2.3