Handle failure to malloc() part of the thread structure.
PR: 83457
This commit is contained in:
parent
c7c5df6fdb
commit
f12a8f9703
@ -2372,12 +2372,13 @@ _thr_alloc(struct pthread *curthread)
|
||||
} else {
|
||||
thread->tcb = _tcb_ctor(thread, 1 /* initial tls */);
|
||||
}
|
||||
if (thread->tcb == NULL) {
|
||||
thread->siginfo = calloc(_SIG_MAXSIG, sizeof(siginfo_t));
|
||||
if ((thread->tcb == NULL) || (thread->siginfo == NULL)) {
|
||||
if (thread->siginfo != NULL)
|
||||
free(thread->siginfo);
|
||||
free(thread);
|
||||
thread = NULL;
|
||||
} else {
|
||||
thread->siginfo = calloc(_SIG_MAXSIG,
|
||||
sizeof(siginfo_t));
|
||||
/*
|
||||
* Initialize thread locking.
|
||||
* Lock initializing needs malloc, so don't
|
||||
|
@ -2372,12 +2372,13 @@ _thr_alloc(struct pthread *curthread)
|
||||
} else {
|
||||
thread->tcb = _tcb_ctor(thread, 1 /* initial tls */);
|
||||
}
|
||||
if (thread->tcb == NULL) {
|
||||
thread->siginfo = calloc(_SIG_MAXSIG, sizeof(siginfo_t));
|
||||
if ((thread->tcb == NULL) || (thread->siginfo == NULL)) {
|
||||
if (thread->siginfo != NULL)
|
||||
free(thread->siginfo);
|
||||
free(thread);
|
||||
thread = NULL;
|
||||
} else {
|
||||
thread->siginfo = calloc(_SIG_MAXSIG,
|
||||
sizeof(siginfo_t));
|
||||
/*
|
||||
* Initialize thread locking.
|
||||
* Lock initializing needs malloc, so don't
|
||||
|
Loading…
Reference in New Issue
Block a user