summaryrefslogtreecommitdiffstats
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.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c
index 6fe2171..6c00e43 100644
--- a/sys/kern/kern_exit.c
+++ b/sys/kern/kern_exit.c
@@ -494,6 +494,12 @@ loop:
}
/*
+ * Remove unused arguments
+ */
+ if (p->p_args && --p->p_args->ar_ref == 0)
+ FREE(p->p_args, M_PARGS);
+
+ /*
* Finally finished with old proc entry.
* Unlink it from its process group and free it.
*/
OpenPOWER on IntegriCloud