aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2005-08-29 13:49:18 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2005-08-29 13:49:18 +0000
commitf12a8f9703ff07160cab6341300a0818855928b2 (patch)
treebeda97139efb78dbe127d83d9f162ef835e71f68 /lib/libpthread
parentc7c5df6fdbc7f7457c7a87e4b1c61e23892b9653 (diff)
Notes
Diffstat (limited to 'lib/libpthread')
-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 aec254122a50..85d9b33fafa3 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