summaryrefslogtreecommitdiff
path: root/sys/kern/kern_exit.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/kern/kern_exit.c')
-rw-r--r--sys/kern/kern_exit.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 6afae81..2f9e344 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -137,6 +137,10 @@ exit1(struct proc *td, int flags)
proc_reap(td);
}
+ if (td->data != NULL) {
+ dynfree(td->data);
+ }
+
/*
* Only free the process structure if we aren't
* being waited on, otherwise let it be so the
@@ -157,8 +161,6 @@ exit1(struct proc *td, int flags)
ci->curtd = NULL;
if (parent->pid == 0)
sched_enter();
- if (td->data == NULL)
- sched_enter();
parent->flags &= ~PROC_SLEEP;
sched_enter();
@@ -175,7 +177,6 @@ sys_exit(struct syscall_args *scargs)
{
struct proc *td = this_td();
- td->data = scargs->tf;
td->exit_status = scargs->arg0;
exit1(td, 0);
__builtin_unreachable();