aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nptl/allocatestack.c3
1 files changed, 2 insertions, 1 deletions
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;
}
}