diff options
| author | Daniel Eischen <deischen@FreeBSD.org> | 2005-08-29 13:49:18 +0000 |
|---|---|---|
| committer | Daniel Eischen <deischen@FreeBSD.org> | 2005-08-29 13:49:18 +0000 |
| commit | f12a8f9703ff07160cab6341300a0818855928b2 (patch) | |
| tree | beda97139efb78dbe127d83d9f162ef835e71f68 /lib/libpthread | |
| parent | c7c5df6fdbc7f7457c7a87e4b1c61e23892b9653 (diff) | |
Notes
Diffstat (limited to 'lib/libpthread')
| -rw-r--r-- | lib/libpthread/thread/thr_kern.c | 7 |
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 |
