(get_cached_stack): Don't crash if we first found a stack with a larger size then...
authorUlrich Drepper <drepper@redhat.com>
Tue, 3 Dec 2002 20:06:21 +0000 (20:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Tue, 3 Dec 2002 20:06:21 +0000 (20:06 +0000)
nptl/allocatestack.c

index e9e1cfd..9f12f2b 100644 (file)
@@ -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;
        }
     }