summaryrefslogtreecommitdiffstats
path: root/lib/libpthread/thread/thr_kern.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libpthread/thread/thr_kern.c')
-rw-r--r--lib/libpthread/thread/thr_kern.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/libpthread/thread/thr_kern.c b/lib/libpthread/thread/thr_kern.c
index aec2541..85d9b33 100644
--- a/lib/libpthread/thread/thr_kern.c
+++ b/lib/libpthread/thread/thr_kern.c
@@ -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
OpenPOWER on IntegriCloud