diff --git a/sys/kern/kern_sig.c b/sys/kern/kern_sig.c index 541ea2bdf68f..3d9e08aebea2 100644 --- a/sys/kern/kern_sig.c +++ b/sys/kern/kern_sig.c @@ -3210,8 +3210,7 @@ coredump(struct thread *td) MPASS((p->p_flag & P_HADTHREADS) == 0 || p->p_singlethread == td); _STOPEVENT(p, S_CORE, 0); - name = expand_name(p->p_comm, td->td_ucred->cr_uid, p->p_pid, td, - compress); + name = expand_name(p->p_comm, cred->cr_uid, p->p_pid, td, compress); if (name == NULL) { PROC_UNLOCK(p); #ifdef AUDIT