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; } }