Unref the prison after proctree is dropped.

This commit is contained in:
Mateusz Guzik 2018-02-17 00:23:56 +00:00
parent 65f29b9caa
commit 7e588b9219
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=329421

View File

@ -530,9 +530,6 @@ exit1(struct thread *td, int rval, int signo)
PROC_LOCK(p);
p->p_xthread = td;
/* Tell the prison that we are gone. */
prison_proc_free(p->p_ucred->cr_prison);
#ifdef KDTRACE_HOOKS
/*
* Tell the DTrace fasttrap provider about the exit if it
@ -603,6 +600,9 @@ exit1(struct thread *td, int rval, int signo)
PROC_LOCK(p->p_pptr);
sx_xunlock(&proctree_lock);
/* Tell the prison that we are gone. */
prison_proc_free(p->p_ucred->cr_prison);
/*
* The state PRS_ZOMBIE prevents other proesses from sending
* signal to the process, to avoid memory leak, we free memory