diff options
-rw-r--r-- | sys/kern/kern_thread.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/sys/kern/kern_thread.c b/sys/kern/kern_thread.c index 1b26e8f..dd8f80c 100644 --- a/sys/kern/kern_thread.c +++ b/sys/kern/kern_thread.c @@ -592,8 +592,10 @@ thread_wait(struct proc *p) KASSERT((p->p_numksegrps == 1), ("Multiple ksegrps in wait1()")); FOREACH_THREAD_IN_PROC(p, td) { if (td->td_standin != NULL) { - crfree(td->td_ucred); - td->td_ucred = NULL; + if (td->td_standin->td_ucred != NULL) { + crfree(td->td_standin->td_ucred); + td->td_standin->td_ucred = NULL; + } thread_free(td->td_standin); td->td_standin = NULL; } |