Fix a null dereference leading to a core dump when

the number of threads exceeds the number of open slots
in ldt_entries[].

Approved by:	markm (mentor)(implicit)
Reviewed by:	jeff
This commit is contained in:
Mike Makonnen 2003-05-06 02:33:49 +00:00
parent ae0df91f34
commit a260623c5f

View File

@ -62,7 +62,10 @@ ldt_init(void)
void
_retire_thread(void *entry)
{
*(void **)entry = *ldt_free;
if (ldt_free == NULL)
*(void **)entry = NULL;
else
*(void **)entry = *ldt_free;
ldt_free = entry;
}